Advertisement
Guest User

Untitled

a guest
May 2nd, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. # check that we have something mildly sane as our shell, or try to find something better
  2. if false ^ printf "%s: WARNING: ancient shell, hunting for a more modern one... " "$0"
  3. then
  4. SANE_SH=${SANE_SH:-/usr/bin/ksh}
  5. if printf 'true ^ false\n' | "$SANE_SH"
  6. then
  7. printf "'%s' seems viable.\n" "$SANE_SH"
  8. exec "$SANE_SH" "$0" "$@"
  9. else
  10. cat <<-EOF
  11. oh dear.
  12.  
  13. If you have a more recent shell available, that supports \$(...) etc.
  14. please try setting the environment variable SANE_SH to the path of that
  15. shell, and then retry running this script. If that works, please report
  16. a bug describing your setup, and the shell you used to make it work.
  17.  
  18. EOF
  19. printf "%s: ERROR: Less dimwitted shell required.\n" "$0"
  20. exit 1
  21. fi
  22. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement