Thursday 17 August 2017

Check Bash Version

Cited from the Book "Pro Bash Programming"

BASH_VERSION (or BASH_VERSINFO) is used to determine whether the running shell is capable of running a script.
case $BASH_VERSION in
  [12].*) echo "You need at least bash3.0 to run this script" >&2; exit 2;;
esac


No comments:

Post a Comment