Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. $ # here everything is still normal
  2. $ bash -c 'exit 1';echo $?
  3. 1
  4. $ bash -c 'exit 255';echo $?
  5. 255
  6. $ zsh -c 'exit 255';echo $?
  7. 255
  8. $ # now it get's crazy
  9. $ bash -c 'exit 256';echo $?
  10. 0
  11. $ zsh -c 'exit 256';echo $?
  12. 0
  13. $ # (leaving away zsh for now, it is always reproducible with both)
  14. $ bash -c 'exit 257';echo $?
  15. 1
  16. $ bash -c 'exit 267';echo $?
  17. 11
  18.  
  19. exit [n]
  20. Cause the shell to exit with a status of n. If n is omitted,
  21. the exit status is that of the last command executed. A trap on
  22. EXIT is executed before the shell terminates.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement