shell dot on steroids https://pagure.io/shellfu

exit.sh 527B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. EXIT_OK=0
  3. EXIT_NO=1
  4. EXIT_USAGE=2
  5. EXIT_ERROR=3
  6. EXIT_PANIC=4
  7. exit_ok() {
  8. #
  9. # Exit script with success
  10. #
  11. exit $EXIT_OK
  12. }
  13. exit_no() {
  14. #
  15. # Exit script with answer "no"
  16. #
  17. exit $EXIT_NO
  18. }
  19. exit_usage() {
  20. #
  21. # Exit script with usage error
  22. #
  23. exit $EXIT_USAGE
  24. }
  25. exit_error() {
  26. #
  27. # Exit script with generic unexpected error
  28. #
  29. exit $EXIT_ERROR
  30. }
  31. exit_panic() {
  32. #
  33. # Exit script in panic (e.g. assert failure, sure bug)
  34. #
  35. exit $EXIT_PANIC
  36. }