diff options
author | Alexander Kapshuk <alexander.kapshuk@gmail.com> | 2015-10-12 14:39:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-18 00:55:26 -0400 |
commit | 1d60b873aecc6fce4893b76500c30374f8c9e394 (patch) | |
tree | de5176f5720dfe84d4b728e255b12bbc09c02a12 | |
parent | 235024e519fa16242f916ec41b00547582f561a7 (diff) |
ver_linux: make --version, use regex to find version number
Rely on regex to find the version number, rather than a field number.
Reduce the number of 'awk' invocations from two to one.
Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rwxr-xr-x | scripts/ver_linux | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/ver_linux b/scripts/ver_linux index af6467e4859a..31c0e4d09ffc 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux | |||
@@ -18,8 +18,12 @@ awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{ | |||
18 | substr($0,RSTART,RLENGTH)) | 18 | substr($0,RSTART,RLENGTH)) |
19 | }' | 19 | }' |
20 | 20 | ||
21 | make --version 2>&1 | awk -F, '{print $1}' | awk \ | 21 | make --version 2>&1 | |
22 | '/GNU Make/{print "Gnu make ",$NF}' | 22 | awk '/GNU Make/{ |
23 | match($0, /[0-9]+([.]?[0-9]+)+/) | ||
24 | printf("GNU Make\t\t%s\n", | ||
25 | substr($0,RSTART,RLENGTH)) | ||
26 | }' | ||
23 | 27 | ||
24 | echo "binutils $(ld -v | egrep -o '[0-9]+\.[0-9\.]+')" | 28 | echo "binutils $(ld -v | egrep -o '[0-9]+\.[0-9\.]+')" |
25 | 29 | ||