From: Mike Frysinger <vapier@gentoo.org>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 0/4] Replace commonly used perl tools with awk equivalents
Date: Wed, 4 Apr 2012 13:54:17 -0400 [thread overview]
Message-ID: <201204041354.18403.vapier@gentoo.org> (raw)
In-Reply-To: <CAGH67wR-2oyoiqiP1mBzinJ_AokW4Ce0yj5riuih1KTO0kUBcA@mail.gmail.com>
[-- Attachment #1.1: Type: Text/Plain, Size: 1973 bytes --]
On Wednesday 04 April 2012 13:31:10 Garrett Cooper wrote:
> On Wed, Apr 4, 2012 at 10:22 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On Wednesday 04 April 2012 01:23:43 Garrett Cooper wrote:
> >> The intent behind these changes are to remove unnecessary perl
> >> dependencies in LTP by using awk in its stead. It was something that was
> >> discussed a while ago on ltp-list@.
> >
> > i like awk over perl a lot. my only concern is non-POSIX stuff slipping
> > in (such as people who have gawk installed). should we add a local
> > wrapper script that sees if the awk accepts a --posix flag and
> > automatically pass it ?
>
> That's actually a gawk-ism :)...
yes, that's why i phrased it "if the awk accepts"
awk --help | grep -q -e --posix && args="${args} --posix"
> Seeing how Android and some other Linux distros like borrowing bits
> and pieces from BSD, I think that using --posix might not guarantee
> much (on the bright side it doesn't error out either with 'the
> one-true-awk'):
perhaps, but gawk provides a lot of useful funcs that i know i use that aren't
in POSIX, and we want to make sure these things don't slip in. telling people
"make sure you test with XXX awk" is certain to be error prone.
plus, there are certain edge conditions which are very subtle. consider the
handling of substr() and the starting position of "0":
echo abc | mawk '{print substr($0, 0, 2)}' -> a
echo abc | gawk '{print substr($0, 0, 2)}' -> ab
echo abc | mawk '{print substr($0, 1, 2)}' -> ab
echo abc | gawk '{print substr($0, 1, 2)}' -> ab
> I understand the goals, but looking at the manpage on opengroup and
> through one-true-awk's source, there's nothing consistent that
> guarantees that POSIX is adhered to in awk (but there probably should
> be a flag, environment variable, etc).
POSIX should be the LCD we work with without accidentally using something that
is specific to a single awk
-mike
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 274 bytes --]
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2012-04-04 17:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-04 5:23 [LTP] [PATCH 0/4] Replace commonly used perl tools with awk equivalents Garrett Cooper
2012-04-04 17:22 ` Mike Frysinger
2012-04-04 17:31 ` Garrett Cooper
2012-04-04 17:54 ` Mike Frysinger [this message]
[not found] ` <201204042028.52373.vapier@gentoo.org>
[not found] ` <alpine.BSF.2.00.1204041732320.25027@toaster.local>
[not found] ` <201204042149.20439.vapier@gentoo.org>
2012-04-06 3:34 ` Garrett Cooper
2012-04-06 16:19 ` Caspar Zhang
2012-04-07 2:31 ` Wanlong Gao
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=201204041354.18403.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=ltp-list@lists.sourceforge.net \
--cc=yanegomi@gmail.com \
/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