Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # check that we have something mildly sane as our shell, or try to find something better
- if false ^ printf "%s: WARNING: ancient shell, hunting for a more modern one... " "$0"
- then
- SANE_SH=${SANE_SH:-/usr/bin/ksh}
- if printf 'true ^ false\n' | "$SANE_SH"
- then
- printf "'%s' seems viable.\n" "$SANE_SH"
- exec "$SANE_SH" "$0" "$@"
- else
- cat <<-EOF
- oh dear.
- If you have a more recent shell available, that supports \$(...) etc.
- please try setting the environment variable SANE_SH to the path of that
- shell, and then retry running this script. If that works, please report
- a bug describing your setup, and the shell you used to make it work.
- EOF
- printf "%s: ERROR: Less dimwitted shell required.\n" "$0"
- exit 1
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement