I'm trying to create some scripts to execute commands on Summit boxes using SSH but, even though the commands execute correctly, I always get 255 (-1) as the exit code. From OpenSSH man page I saw that 255 is expected to indicate errors like a connection failure, which clearly is not the case. Isn't EXOS supposed to return 0 when everything works correctly?
#> ssh user1@summitBox "show version | include Extreme"
Enter password for user1:
Image : ExtremeXOS version 188.8.131.52 by release-manager
#> echo $?
[/code]Am I doing something wrong?
From ssh man page:
ssh exits with the exit status of the remote command or with 255 if an error occurred.
The problem with this behavior is that it breaks any automation script that expects a value between 0 and 254 as the return code when no error occurs with the ssh client itself.
Thanks for any tips!