History

ver_linux: xfsprogs, 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 44422f31 parent 63e781a1 file · +6 −2Browse files

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

Unified · Split

scripts/ver_linux+6−2
@@ -70,8 +70,12 @@ awk '/^reiserfsck/{ · 69 unmodified lines
70fsck.reiser4 -V 2>&1 | grep ^fsck.reiser4 | awk \70fsck.reiser4 -V 2>&1 | grep ^fsck.reiser4 | awk \
71'NR==1{print "reiser4progs ", $2}'71'NR==1{print "reiser4progs ", $2}'
72 72
73xfs_db -V 2>&1 | grep version | awk \73xfs_db -V 2>&1 |
74'NR==1{print "xfsprogs ", $3}'74awk '/version/{
75 match($0, /[0-9]+([.]?[0-9]+)+/)
76 printf("Xfsprogs\t\t%s\n",
77 substr($0,RSTART,RLENGTH))
78}'
75 79
76pccardctl -V 2>&1| grep pcmciautils | awk '{print "pcmciautils ", $2}'80pccardctl -V 2>&1| grep pcmciautils | awk '{print "pcmciautils ", $2}'
77 81