9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] empty *
@ 2012-06-14  8:28 Gorka Guardiola
  2012-06-14  9:32 ` Peter A. Cejchan
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Gorka Guardiola @ 2012-06-14  8:28 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

While playing with grep, I was suprised by grep '*\.c' not giving
an error (* is missing an operand). Arguably * applied to empty
can match empty, but surprisingly enough, Acme's edit behaves
differently. And even grep is not consistent (grep '*' is different than
grep '' whereas both should be an empty pattern or the first one
should be an error). Another funny one is that Edit gives back
an error complaining of missing operand to * when the regexp is
empty.

Greps from other systems accept an empty pattern
(and are thus consistent but they would not have
catched the error starting all this).


cpu% echo hola | grep '*a'
hola
cpu%  echo hola | grep '*'
grep: *: syntax error
cpu%  echo hola | grep ''
grep: empty pattern

Edit , s/*//
regexp: missing operand for *
Edit: bad regexp in s command

Edit , s/*c//
regexp: missing operand for *
Edit: bad regexp in s command

Edit , s///

regexp: missing operand for *
Edit: bad regexp in s command

G.



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-06-14 15:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CACm3i_g9m6sVaBvvydKYyBxwE=NGYmhmpM4Nko6gE5uUngSwXA@mail.gmail.c>
2012-06-14 13:33 ` [9fans] empty * erik quanstrom
2012-06-14 13:38   ` Gorka Guardiola
     [not found]   ` <CACm3i_hoeuq10w5=Ri+-nocm1Str2USwTBW1m5iuhSxdU3_pMA@mail.gmail.c>
2012-06-14 13:44     ` erik quanstrom
2012-06-14 14:00       ` tlaronde
2012-06-14 14:13         ` Gorka Guardiola
2012-06-14 14:36           ` tlaronde
2012-06-14 14:49             ` erik quanstrom
2012-06-14 15:08               ` tlaronde
     [not found]         ` <CACm3i_hRKnkDW6SgFQQ3B4zfr3UHim=-x_uA0iYYRzZz0W8Xag@mail.gmail.c>
2012-06-14 14:46           ` erik quanstrom
2012-06-14 14:50             ` Gorka Guardiola
2012-06-14 14:05       ` Lucio De Re
2012-06-14  8:28 Gorka Guardiola
2012-06-14  9:32 ` Peter A. Cejchan
2012-06-14  9:54   ` Gorka Guardiola
2012-06-14  9:42 ` Anthony Martin
2012-06-14 13:29   ` erik quanstrom
     [not found] ` <CAM6ozu51kzDLxB0KoT96udomrKyHWuHvwqSum6=aXmonpr8kXQ@mail.gmail.c>
2012-06-14 13:28   ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).