History

ver_linux: quota-tools, 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'.

Alexander Kapshuk committed 11 years ago

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

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/ver_linux+6−2
@@ -87,8 +87,12 @@ awk '/pcmciautils/{ · 86 unmodified lines
87cardmgr -V 2>&1| grep version | awk \87cardmgr -V 2>&1| grep version | awk \
88'NR==1{print "pcmcia-cs ", $3}'88'NR==1{print "pcmcia-cs ", $3}'
89 89
90quota -V 2>&1 | grep version | awk \90quota -V 2>&1 |
91'NR==1{print "quota-tools ", $NF}'91awk '/version/{
92 match($0, /[0-9]+([.]?[0-9]+)+/)
93 printf("Quota-tools\t\t%s\n",
94 substr($0,RSTART,RLENGTH))
95}'
92 96
93pppd --version 2>&1| grep version | awk \97pppd --version 2>&1| grep version | awk \
94'NR==1{print "PPP ", $3}'98'NR==1{print "PPP ", $3}'

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t