Topic "shell status"

Author Message
BernG
[View user's profile]

Joined: 2009-11-26
Posts: 3
Location: Germany
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.

Quote:
[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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
You can configure the variable on login dialog.
_________________
Martin Prikryl
BernG
[View user's profile]

Joined: 2009-11-26
Posts: 3
Location: Germany
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!
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License