Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1238872
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Alexander Kapshuk <alexander.kapshuk@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 9/24] ver_linux: jfsutils.patch |
| Date | Sat, 03 Oct 2015 15:30:02 +0200 |
| Message-ID | <qfv2W-33F-7@gated-at.bofh.it> (permalink) |
| X-Original-To | linux-kernel <linux-kernel@vger.kernel.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=nOyNU2dYxuZtQ22OIj5mKWic/sJkufUI1ZajM3D7nvs=; b=MpNLO0xPjYm97pgF6d0icNjYVrA2L2qOnym7fS68npA8dsM+2fMMjif2rDs9N8w9qa d9GbWb3MboXJTBiwLkD2jyFvX3V1OzSeS5hAULqNgY+pCGjqGz6LuMq+izK88TnI5joz CPzXLrb5ONCwZQbNeaTUfwMssuwq8KFfeaFsSi0q6Z97W+OAjtyi68QMe3wMN/K6va6Y 6cOOy5ze18qJZRJcvwoKS7uccc7BaUCr/rH8tqZlM/W8nL2L091g+S7Xt5O4roIOSApi d0V32sHYH62put2UWXm2dYUMbXeYHtvbGBflwqE26mIx3yqe3SovlDEPmOymxPVkVsps RK1w== |
| X-Received | by 10.112.205.231 with SMTP id lj7mr7842411lbc.57.1443878989932; Sat, 03 Oct 2015 06:29:49 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 40 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Greg KH <gregkh@linuxfoundation.org> |
| X-Original-Date | Sat, 3 Oct 2015 16:29:10 +0300 |
| X-Original-Message-ID | <CAJ1xhMU9pV7omZSGcqpJe_6ch7Uf14EV3kpqXMPVr+DAi2s-mA@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1238872 |
Show key headers only | View raw
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@gmail.com>
---
--- linux/scripts/ver_linux.orig 2015-10-03 13:41:57.118790241 +0300
+++ linux/scripts/ver_linux 2015-10-03 13:52:43.291120818 +0300
@@ -30,8 +30,15 @@
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}'
+test -x "$fsckjfs" &&
+$fsckjfs -V 2>&1 |
+sed '
+ /version/!d
+ s/.*version[ \t]//
+ s/[ \t].*//
+ s/[^0-9]$//
+ s/^/jfsutils\t\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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 9/24] ver_linux: jfsutils.patch Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2015-10-03 15:30 +0200
csiph-web