From: Andre Noll Date: Sat, 25 Sep 2010 16:56:25 +0000 (+0200) Subject: gsu: Error out if not running as bash-4. X-Git-Url: http://git.tuebingen.mpg.de/?p=gsu.git;a=commitdiff_plain;h=1b07e7d284a5147c8002340477051c3a78a08858 gsu: Error out if not running as bash-4. --- diff --git a/funcs/gsu b/funcs/gsu index b409bc5..cef33b2 100644 --- a/funcs/gsu +++ b/funcs/gsu @@ -389,6 +389,16 @@ gsu() { local i + gsu_is_a_number "${BASH_VERSINFO[0]}" + if [[ $ret -lt 0 ]]; then + gsu_msg "fatal: failed to determine bash version" + exit 1 + fi + + if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then + gsu_msg "fatal: This script requires at least bash 4.0" + exit 1 + fi _gsu_self="$(basename $0)" gsu_name="${gsu_name:=$_gsu_self}" gsu_config_var_prefix="${gsu_config_var_prefix:=$gsu_name}"