Skip to content

Instantly share code, notes, and snippets.

@nakajima
Forked from defunkt/exit-codes.sh
Created March 9, 2010 20:20
Show Gist options
  • Select an option

  • Save nakajima/327068 to your computer and use it in GitHub Desktop.

Select an option

Save nakajima/327068 to your computer and use it in GitHub Desktop.
$ 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
$ ruby -e 'exit!'
$ echo $?
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment