[PATCH 15/32] ver_linux: wrap up call to 'cardmgr -V' in awk function

From: Alexander Kapshuk
Date: Tue Jun 28 2016 - 06:25:41 EST


Wrap up the call to 'cardmgr -V', the code to process its output,
and the resulting formatted output in awk functions.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@xxxxxxxxx>
---
scripts/ver_linux | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index b2145a9..cdcd284 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -24,9 +24,7 @@ BEGIN {
printversion("Reiser4fsprogs", version("fsck.reiser4 -V 2>&1"))
printversion("Xfsprogs", version("xfs_db -V 2>&1"))
printversion("Pcmciautils", version("pccardctl -V 2>&1"))
-
-cardmgr -V 2>&1| grep version | awk \
-'NR==1{print "pcmcia-cs ", $3}'
+ printversion("Pcmcia-cs", version("cardmgr -V 2>&1"))

quota -V 2>&1 |
awk '/version/{
--
2.7.3