[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Case insensitivity seems to ignore lower bound of interval
From: |
Eric Bischoff |
Subject: |
Re: Case insensitivity seems to ignore lower bound of interval |
Date: |
Thu, 28 Apr 2011 15:12:14 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.2; x86_64; ; ) |
Le jeudi 28 avril 2011 14:04:28, Davide Brini a écrit :
> But you got me curious. My original test system used mostly vanilla tools
> built from source, so I thought I would try on stock distros instead.
> And guess what, both on a standard RHEL 6 and Debian squeeze, I see your
> results (ie gawk behaves differently).
OK, that's interesting information. That means that either those distributions
patch the tools, either there's some compilation option that differs.
I have tested 6 stock distros too, all with the same behaviour forgawk (I have
not tested sed nor grep yet).
> Maybe, but my point was that it was no gawk-only bug. But now, having been
> able to reproduce your results, it may well be that gawk does something
> different. Arnold is the authoritative source here.
Yes, and let me take the occasion to thank him for all the great work on gawk
and the nice documentation.
> > My list of letters in the "echo" part intentionally was stopping at "r"
> > in the grep test, to concentrate on what happens to "r", without
> > influence from what happens to "s".
>
> If you stop at "r", you won't get any output.
>
> The only way you would get
> output is if [R-Z] was implemented as "RrSs..." etc., which seems not to
> be the case; rather, it seems to be the other way round ("rRsS..." etc.).
Correct.
Ah, you were right, grep behaves as awk on this, I did not test thoroughly
enough:
$ echo 'ijklmnopqs' | grep '[R-Z]'
ijklmnopqs
$ echo 'ijklmnopqr' | grep '[R-Z]'
$
$ echo 'ijklmnopqs' | awk '/[R-Z]/ { print }'
ijklmnopqs
$ echo 'ijklmnopqr' | awk '/[R-Z]/ { print }'
$
That does not make it more logical :-), and sed is definitely different:
$ echo 'ijklmnopqs' | sed '/[R-Z]/p'
ijklmnopqs
$ echo 'ijklmnopqr' | sed '/[R-Z]/p'
ijklmnopqr
$ echo 'ijklmnopqR' | sed '/[R-Z]/p'
ijklmnopqR
ijklmnopqR
$ echo 'ijklmnopqS' | sed '/[R-Z]/p'
ijklmnopqS
ijklmnopqS
--
Éric Bischoff - Bureau Cornavin
Technical writing and translations
http://www.bureau-cornavin.com
(+33) 3 68 46 00 85
sip:address@hidden
- Re: Case insensitivity seems to ignore lower bound of interval, (continued)
Re: Case insensitivity seems to ignore lower bound of interval, arnold, 2011/04/28
Re: Case insensitivity seems to ignore lower bound of interval, Paul Jarc, 2011/04/28
Re: Case insensitivity seems to ignore lower bound of interval, Eric Bischoff, 2011/04/29
Re: Case insensitivity seems to ignore lower bound of interval, Aharon Robbins, 2011/04/29