Re: egrep and conditions



Seebs wrote:

JAW wrote:
I am looking to get a zero return code only if offset and gov are in
the display

You probably want:
"(offset.*gov)|(gov.*offset)"

Thinking this through should explain all. (Note that I may have gotten
the backslashes wrong, I'm not really awake yet.)

It is correct, no backslashes are needed here (with *e*grep). One does not
need the parentheses, though, because concatenation binds stronger than
alternation:

egrep -e 'offset.*gov|gov.*offset' >/dev/null 2>&1

--
PointedEars

Bitte keine Kopien per E-Mail. / Please do not Cc: me.
.



Relevant Pages

  • Re: Word 2007 buggy and crashes.
    ... Microsoft MVP (Word) ... they'll display in Explorer the way they're typed in:) Following ... links defaults to backslashes. ... Suzanne S. Barnhill << ...
    (microsoft.public.word.application.errors)
  • Re: Word 2007 buggy and crashes.
    ... they'll display in Explorer the way they're typed in:) Following links defaults to backslashes. ... they're displayed in the Explorer address bar with ...
    (microsoft.public.word.application.errors)
  • Re: egrep and conditions
    ... the display ... the backslashes wrong, I'm not really awake yet.) ... I am not speaking for my employer, although they do rent some of my opinions. ...
    (comp.unix.shell)
  • Re: Renaming recursive functions
    ... (else (display n) ... (What on earth are those backslashes doing? ... I'm pretending that they ...
    (comp.lang.scheme)
  • Re: Problem with my site displaying in I.E.
    ... What's with all the backslashes? ... I've never seen a blank page display ... I use flash for my ... navigation and header...I'm thinking maybe that is the problem? ...
    (microsoft.public.windows.inetexplorer.ie6.browser)