The command "bash --version" output "Version 4.x", but in a chinese locale system will display as "版本 4.x".
Signed-off-by: Guo Ren ren_guo@c-sky.com --- scripts/prereq.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/prereq.sh b/scripts/prereq.sh index 0222172..ca2b546 100755 --- a/scripts/prereq.sh +++ b/scripts/prereq.sh @@ -225,7 +225,7 @@ printf " ---> checking if bash is installed.. " if which bash >/dev/null; then printf "found\n" printf " ---> checking if it is bash 4.x.. " - bash --version 2>/dev/null| grep -i "Version 4" >/dev/null + bash --version 2>/dev/null| grep "GNU bash" | grep -i " 4." >/dev/null if [ $? -eq 0 ]; then printf "yes\n" else
Hi Guo, Guo Ren wrote,
The command "bash --version" output "Version 4.x", but in a chinese locale system will display as "版本 4.x".
Signed-off-by: Guo Ren ren_guo@c-sky.com
Thanks, applied and pushed, Waldemar
On Tue, 28 Nov 2017, Guo Ren wrote:
The command "bash --version" output "Version 4.x", but in a chinese locale system will display as "版本 4.x".
Signed-off-by: Guo Ren ren_guo@c-sky.com
scripts/prereq.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/prereq.sh b/scripts/prereq.sh index 0222172..ca2b546 100755 --- a/scripts/prereq.sh +++ b/scripts/prereq.sh @@ -225,7 +225,7 @@ printf " ---> checking if bash is installed.. " if which bash >/dev/null; then printf "found\n" printf " ---> checking if it is bash 4.x.. "
- bash --version 2>/dev/null| grep -i "Version 4" >/dev/null
- bash --version 2>/dev/null| grep "GNU bash" | grep -i " 4." >/dev/null
Probably you mean grep " 4." or grep -F " 4." or even LANG=C bash --version | grep -i "version 4"
(grep "." matches any char because argument is a regexp, -i only makes sense for chars which have upper/lower case)
Regards, BALATON Zoltan