Skip to content

Instantly share code, notes, and snippets.

@elvuel
Forked from defunkt/exit-codes.sh
Created May 18, 2011 07:07
Show Gist options
  • Save elvuel/978116 to your computer and use it in GitHub Desktop.
Save elvuel/978116 to your computer and use it in GitHub Desktop.
Ruby exit codes
$ ruby -e 'exit'
$ echo $?
0
$ ruby -e 'exit 1'
$ echo $?
1
$ ruby -e 'abort "oh no"'
oh no
$ echo $?
1
$ ruby -e 'fail "oh no"'
-e:1: oh no (RuntimeError)
$ echo $?
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment