Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

BernG

Re: shell status

Oh right, there it is under Environment / SCP/Shell. I had searched for it several times before but must have overlooked it all the time.

Now with autodetect turned off, my custom commands work perfectly!

Thanks a lot!
martin

Re: shell status

You can configure the variable on login dialog.
BernG

shell status

WinSCP's custom commands can run commands on the server side.
This does not work with a HP-UX v11 system as server: WinSCP checks the $status variable for return status. But on HP-UX's flavour of bourne shell, the return status is in the $? variable.

[Shell] Looking up host "my.server.com"
[Shell] Connecting to port 22
[Shell] Server version: SSH-2.0-OpenSSH_4.3p2-hpn
[Shell] Using SSH protocol version 2
[Shell] We claim version: SSH-2.0-WinSCP_release_4.2.4
[Shell] Doing Diffie-Hellman group exchange
[Shell] Doing Diffie-Hellman key exchange with hash SHA-1
[Shell] Host key fingerprint is:
[Shell] ssh-rsa 2048 ab:cd:ef:01:23:45:67:89:0a:bc:de:f0:12:34:56:78
[Shell] Initialised AES-256 SDCTR client->server encryption
[Shell] Initialised HMAC-SHA1 client->server MAC algorithm
[Shell] Initialised AES-256 SDCTR server->client encryption
[Shell] Initialised HMAC-SHA1 server->client MAC algorithm
[Shell] Pageant is running. Requesting keys.
[Shell] Pageant has 1 SSH-2 keys
[Shell] Using username "berng"
[Shell] Trying Pageant key #0
[Shell] Authenticating with public key "my private key" from agent
[Shell] Sending Pageant's response
[Shell] Access granted
[Shell] Opened channel for session
[Shell] Started a shell/command
[Shell] --------------------------------------------------------------------------
[Shell] Using SCP protocol.
[Shell] Doing startup conversation with host.
[Shell] Skipping host startup message (if any).
[Shell] echo "WinSCP: this is end-of-file:0"

[Shell] ttytype: couldn't open /dev/tty for reading
[Shell] stty: : Invalid argument

[Shell] You have mail.
[Shell] Not a terminal
[Shell] stty: : Invalid argument
[Shell] stty: : Invalid argument

[Shell] Value of TERM has been set to "xterm".
[Shell] ****************************************************************
[Shell] Welcome to MyServer
[Shell] ****************************************************************
[Shell] WinSCP: this is end-of-file:0

[Shell] Detecting variable containing return code of last command.
[Shell] Trying "$status".
[Shell] echo "$status" ; echo "WinSCP: this is end-of-file:0"
[Shell] sh[2]: status: Parameter not set.
[Shell] Server sent command exit status 1
[Shell] Disconnected: All channels closed
Initiating key re-exchange (timeout)
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-1
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm


Maybe the problem is that in some circumstances, HP-UX's sh returns an error message on undefined shell variables (instead of just an empty string).

BTW, to me this is not an urgent issue.