Die function for bash


/ Published in: Bash
Save to your folder(s)

Impletement die function for bash


Copy this code and paste it in your HTML
  1. # $1 - the exit code
  2. # $2 $... - the message string
  3. die()
  4. {
  5. retcode=$1
  6. shift
  7. printf >&2 "%s\n" "$@"
  8. exit $retcode
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.