From: Pavel Machek <pavel@ucw.cz>
To: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
jim.epost@gmail.com, richard@nod.at, tytso@mit.edu
Subject: Re: [PATCH 01/22] ver_linux: gcc -dumpversion, use regex to find version number
Date: Wed, 2 Dec 2015 15:24:45 +0100 [thread overview]
Message-ID: <20151202072725.GA26580@amd> (raw)
In-Reply-To: <1444675202-1375-1-git-send-email-alexander.kapshuk@gmail.com>
On Mon 2015-10-12 21:39:41, Alexander Kapshuk wrote:
> Rely on regex to find the version number, rather than a field
number.
Are you sure that is good idea?
I'd say that the field number is going to fail in more obvious way,
which is a good thing.
Pavel
> Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
> ---
> scripts/ver_linux | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/ver_linux b/scripts/ver_linux
> index 7de36df..af6467e 100755
> --- a/scripts/ver_linux
> +++ b/scripts/ver_linux
> @@ -11,8 +11,12 @@ echo ' '
> uname -a
> echo ' '
>
> -gcc -dumpversion 2>&1| awk \
> -'NR==1{print "Gnu C ", $1}'
> +gcc -dumpversion 2>&1 |
> +awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
> + match($0, /[0-9]+([.]?[0-9]+)+/)
> + printf("GNU C\t\t\t%s\n",
> + substr($0,RSTART,RLENGTH))
> +}'
>
> make --version 2>&1 | awk -F, '{print $1}' | awk \
> '/GNU Make/{print "Gnu make ",$NF}'
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
prev parent reply other threads:[~2015-12-02 14:24 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 18:39 [PATCH 01/22] ver_linux: gcc -dumpversion, use regex to find version number Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 02/22] ver_linux: make --version, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 03/22] ver_linux: binutils, fix inaccurate output Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 04/22] ver_linux: util-linux, 'fdformat' not ubiquitous any longer Alexander Kapshuk
2015-10-12 22:04 ` Jim Davis
2015-10-12 18:39 ` [PATCH 05/22] ver_linux: module-init-tools, look for numerical input, not field number Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 06/22] ver_linux: e2fsprogs, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 07/22] ver_linux: jfsutils, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 08/22] ver_linux: reiserfsprogs, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 09/22] ver_linux: xfsprogs, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 10/22] ver_linux: pcmciautils, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 11/22] ver_linux: quota-tools, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 12/22] ver_linux: ppp, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 13/22] ver_linux: libc, input redirection to sed fails in some distros Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 14/22] ver_linux: ldd, look for numerical input, not field number Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 15/22] ver_linux: libcpp, fix missing output Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 16/22] ver_linux: procps, look for numerical input, not field number Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 17/22] ver_linux: net-tools, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 18/22] ver_linux: loadkeys, " Alexander Kapshuk
2015-10-12 18:39 ` [PATCH 19/22] ver_linux: sh-utils, " Alexander Kapshuk
2015-10-12 18:40 ` [PATCH 20/22] ver_linux: use 'udevadm', instead of 'udevinfo' Alexander Kapshuk
2015-10-12 18:40 ` [PATCH 21/22] ver_linux: wireless-tools, look for numerical input, not field number Alexander Kapshuk
2015-10-12 18:40 ` [PATCH 22/22] ver_linux: proc/modules, limit text processing to 'sed' Alexander Kapshuk
2015-10-12 20:22 ` Jim Davis
2015-10-13 17:33 ` Alexander Kapshuk
2015-10-13 23:21 ` [PATCH 01/22] ver_linux: gcc -dumpversion, use regex to find version number Jim Davis
2015-10-14 9:29 ` Alexander Kapshuk
2015-10-14 21:43 ` Jim Davis
2015-12-02 14:24 ` Pavel Machek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151202072725.GA26580@amd \
--to=pavel@ucw.cz \
--cc=alexander.kapshuk@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jim.epost@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@nod.at \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox