Exit 255
Exit status out of range, or ssh failed.
- Value
- 255
- Convention
- Shell and tool convention
A process status is one byte, so exit(-1) arrives as 255 and exit(256) arrives as 0. Separately, ssh exits with 255 when ssh itself hits an error, as opposed to returning the remote command's status. A script that retries on 255 is retrying connection failures, not job failures.
What to check
ssh host true; echo $? # 255 means ssh failed, not the remote commandSources
Exit codes are conventions, not guarantees: a program can return any value from 0 to 255. Spot one that's wrong? Tell Rod.