Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.shell > #4890

Re: grep is screwed on Debian, Ubuntu and others ...

From Kaz Kylheku <kaz@kylheku.com>
Newsgroups comp.unix.shell
Subject Re: grep is screwed on Debian, Ubuntu and others ...
Date 2012-05-04 04:44 +0000
Organization Aioe.org NNTP Server
Message-ID <20120503211141.506@kylheku.com> (permalink)
References <20120503180629.531@kylheku.com> <7QGor.22191$em4.6868@newsfe21.iad>

Show all headers | View raw


On 2012-05-04, Lew Pitcher <lpitcher@teksavvy.com> wrote:
> On Thursday 03 May 2012 21:25, in comp.unix.shell, kaz@kylheku.com wrote:
> Hmmm...  A couple of observations
>
> First, IIRC, the grep character classes (such as [:upper:]) syntatically
> substitute for the "list of characters" that are enclosed by the square
> brackets.
>
> Consequently, the alternate form of '[A-B]' is not '[:upper:]', but instead
> is '[[:upper:]]'. That is, the '[:upper:]' is enclosed within a set of
> square brackets, just like 'A-B' is.

Thanks. You must be the real Lew Pitcher because you have a clue. :)

In my defense, I've never used this committee-designed dog of a syntax until
today, which was only because I was groping for a quick workaround,
and likely never will again.

(I also refuse to implement it in my regex engine, though I have caved in to
Perl's \w, \d, \s, \W, \D and \S, which is probably as far as I will go.)

> Second; I guess that your abberent grep behaviour wrt 'a' is version
> dependant. 

Yes; well of course you would think that at some point in this program's
history, someone implemented the character classes and then actually tried a
few tests at the shell prompt, confirming that they work, an obvious case
being '[A-Z]'.

This is a regression, showing that there is no regression test coverage
for this.

Or, if there is, nobody bothers to run it.

Or if someone runs it, there are portability issues, so it doesn't show
up on his/her machine.

Back to comp.unix.shell | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 01:25 +0000
  Re: grep is screwed on Debian, Ubuntu and others ... Lew Pitcher <lpitcher@teksavvy.com> - 2012-05-03 22:05 -0400
    Re: grep is screwed on Debian, Ubuntu and others ... Ed Morton <mortonspam@gmail.com> - 2012-05-03 21:32 -0500
      Re: grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 04:51 +0000
        Re: grep is screwed on Debian, Ubuntu and others ... Janis Papanagnou <janis_papanagnou@hotmail.com> - 2012-05-04 07:37 +0200
        Re: grep is screwed on Debian, Ubuntu and others ... Ed Morton <mortonspam@gmail.com> - 2012-05-04 08:33 -0500
    Re: grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 04:44 +0000
      Re: grep is screwed on Debian, Ubuntu and others ... Ed Morton <mortonspam@gmail.com> - 2012-05-04 08:47 -0500
      Re: grep is screwed on Debian, Ubuntu and others ... Ivan Shmakov <oneingray@gmail.com> - 2012-05-05 00:38 +0700
        Re: grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 17:45 +0000
          Re: grep is screwed on Debian, Ubuntu and others ... "Ed Morton" <mortonspam@gmail.com> - 2012-05-04 21:20 +0000
          character classes & regular expressions Ivan Shmakov <oneingray@gmail.com> - 2012-05-05 09:35 +0700
            Re: character classes & regular expressions Kaz Kylheku <kaz@kylheku.com> - 2012-05-05 02:42 +0000
              Re: character classes & regular expressions Ivan Shmakov <oneingray@gmail.com> - 2012-05-05 10:00 +0700
            Re: character classes & regular expressions Cydrome Leader <presence@MUNGEpanix.com> - 2012-05-06 02:31 +0000
              Re: character classes & regular expressions Ivan Shmakov <oneingray@gmail.com> - 2012-05-06 12:15 +0700
                Re: character classes & regular expressions Cydrome Leader <presence@MUNGEpanix.com> - 2012-05-06 07:47 +0000
                copyright in Russia Ivan Shmakov <oneingray@gmail.com> - 2012-05-10 19:28 +0700
      Re: grep is screwed on Debian, Ubuntu and others ... Lew Pitcher <lpitcher@teksavvy.com> - 2012-05-04 14:31 -0400
    Re: grep is screwed on Debian, Ubuntu and others ... Richard Kettlewell <rjk@greenend.org.uk> - 2012-05-04 09:12 +0100
    Re: grep is screwed on Debian, Ubuntu and others ... James Waldby <not@valid.invalid> - 2012-05-05 18:25 +0000
  Re: grep is screwed on Debian, Ubuntu and others ... Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> - 2012-05-04 12:56 +0200
    Re: grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 17:47 +0000

csiph-web