[PATCH] ver_linux: jfsutils.patch
From: Alexander Kapshuk
Date: Thu Oct 01 2015 - 14:37:31 EST
Not to be critical of anyone, I believe that using 'grep' along with
'sed', and 'awk' in this kind of context as a one-off quick solution to
be run on the command line may very well be justified.
However, in a script, 'awk' or 'sed' are more than capable of doing most
of the things we may be looking to achieve by using a combination of
'grep', 'sed', and 'awk'.
The proposed implementation relies on 'sed' to perform all the text
processing required.
Tested on:
Arch Linux
Signed-off-by: Alexander Kapshuk <alexander.kapshuk@xxxxxxxxx>
---
--- linux/scripts/ver_linux.orig 2015-08-30 21:34:09.000000000 +0300
+++ linux/scripts/ver_linux 2015-09-30 22:42:39.748757706 +0300
@@ -30,8 +30,14 @@
tune2fs 2>&1 | grep "^tune2fs" | sed 's/,//' | awk \
'NR==1 {print "e2fsprogs ", $2}'
-fsck.jfs -V 2>&1 | grep version | sed 's/,//' | awk \
-'NR==1 {print "jfsutils ", $3}'
+fsck.jfs -V 2>&1 |
+sed '
+ /version/!d
+ s/.*version[ \t]//
+ s/[ \t].*//
+ s/[^0-9]$//
+ s/^/jfsutils\t/
+'
reiserfsck -V 2>&1 | grep ^reiserfsck | awk \
'NR==1{print "reiserfsprogs ", $2}'
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/