Skip to content

Instantly share code, notes, and snippets.

@foreverman
Forked from defunkt/exit-codes.sh
Created May 7, 2012 14:38
Show Gist options
  • Save foreverman/2628134 to your computer and use it in GitHub Desktop.
Save foreverman/2628134 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