Last active
May 25, 2022 22:06
-
-
Save CodeAlDente/3d6f369b0644b8c98c1e3eef9211545a to your computer and use it in GitHub Desktop.
[snippet] Don't run bash script with sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Force a shell script to run under bash instead of sh | |
# https://stackoverflow.com/a/17752318 | |
if [[ ! ${BASH_VERSION} ]]; then | |
echo "Sorry, please run this script with 'bash' only." 1>&2 | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment