Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created March 9, 2010 19:13
Show Gist options
  • Save defunkt/326968 to your computer and use it in GitHub Desktop.
Save defunkt/326968 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