diff options
author | Jacob Bachmeyer <jcb@gnu.org> | 2021-04-16 16:28:43 -0500 |
---|---|---|
committer | Jacob Bachmeyer <jcb@gnu.org> | 2021-04-16 16:28:43 -0500 |
commit | 84c903914b49e5051f116b7a1512ee6d962d71bc (patch) | |
tree | 0a9ea61a146f4f6bf6bcd4ba9555f2268b98fe24 | |
parent | cc4d2e41f5d72be55e2b506f45fa052e1b3d410b (diff) | |
download | dejagnu-84c903914b49e5051f116b7a1512ee6d962d71bc.zip dejagnu-84c903914b49e5051f116b7a1512ee6d962d71bc.tar.gz dejagnu-84c903914b49e5051f116b7a1512ee6d962d71bc.tar.bz2 |
Replace non-portable `grep -q` with shell "case" in dejagnu launcher
-rw-r--r-- | ChangeLog | 3 | ||||
-rwxr-xr-x | dejagnu | 9 |
2 files changed, 7 insertions, 5 deletions
@@ -5,6 +5,9 @@ * dejagnu (command): Use Awk instead of non-portable basename(1) and a non-portable sed(1) pattern to initially set this variable. + * dejagnu: Use shell "case" pattern match instead of non-portable + "grep -q" to determine if "awk" is GNU Awk. + 2021-04-15 Jacob Bachmeyer <jcb@gnu.org> PR47382 @@ -248,11 +248,10 @@ if $have_gawk ; then fi # is "awk" actually GNU Awk? if $have_awk ; then - if "$awkbin" --version | sed 1q | grep -qi 'GNU Awk' ; then - have_gawk_as_awk=true - else - have_gawk_as_awk=false - fi + case `"$awkbin" --version 2>&1 | sed 1q` in + *'GNU Awk'*) have_gawk_as_awk=true ;; + *) have_gawk_as_awk=false ;; + esac fi if expr "$verbose" \> 2 > /dev/null ; then if $have_awk ; then |