History

ver_linux: ppp, look for numerical input, not field number

Rely on regex to find the version number, rather than rely on numerical input to be found in a particular input field. Proposed implementation also eliminates the necessity to invoke 'grep' + 'awk'. Tested on: Oracle Linux

Alexander Kapshuk committed 11 years ago

Commit b903fa91 parent 8fb09591 file · +6 −2Browse files

Unified · Split

scripts/ver_linux+6−2
@@ -94,8 +94,12 @@ awk '/version/{ · 93 unmodified lines
94 substr($0,RSTART,RLENGTH))94 substr($0,RSTART,RLENGTH))
95}'95}'
96 96
97pppd --version 2>&1| grep version | awk \97pppd --version 2>&1 |
98'NR==1{print "PPP ", $3}'98awk '/version/{
99 match($0, /[0-9]+([.]?[0-9]+)+/)
100 printf("PPP\t\t\t%s\n",
101 substr($0,RSTART,RLENGTH))
102}'
99 103
100isdnctrl 2>&1 | grep version | awk \104isdnctrl 2>&1 | grep version | awk \
101'NR==1{print "isdn4k-utils ", $NF}'105'NR==1{print "isdn4k-utils ", $NF}'