From 26647ee5644316a0f2d4b2f51ab9bdd102dbb5b0 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 14 Sep 2007 19:30:56 +0000 Subject: Improve (POSIX-wise) determination of bashh version. --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index d591dc79..125908e0 100755 --- a/configure +++ b/configure @@ -123,8 +123,8 @@ fi # Check bash is present, and at least version 3.0 [ -x /bin/bash ] || do_error "bash 3.0 or above was not found in /bin/bash" -bash_version=$(/bin/bash --version |head -n 1 |cut -d ' ' -f 4) -bash_major=$(echo "${bash_version}" |sed -e 's/\..*//g;') +bash_version=$(/bin/bash --version |sed -r -e '2,$d' -e 's/.* version ([[:digit:]]+).*/\1/;') +bash_major=${bash_version%%.*} [ ${bash_major} -ge 3 ] || do_error "bash 3.0 or above is needed (found ${bash_version})" sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \ -- cgit v1.2.3