Our website would like to use cookies to store information on your computer. You may delete and block all cookies from this site, but parts of the site will not work as a result. Find out more about how we use cookies.

Login or Register

Powered by
Powered by Novacaster
 
Re: linux 'find' command
by Hugo van der Sanden at 01:48 09/08/05 (Forum::Technical Advice::General)
That's where you want to adapt Dave's solution:
  some command | grep -eF 'Message is frozen'

will print only those lines of the output that don't contain the specified string: the 'F' flag means "treat the argument as a fixed string rather than as a regular expression", and the 'e' flag means "print lines that don't match" (normal behaviour being "print lines that do match").

If it really needs to match only lines where that string appears at the end of the line, you need a regular expression:

  grep -e 'Message is frozen$'

.. in which the '$' matches end-of-line.

Be careful when extending this though: when the argument is a regular expression, various punctuation characters acquire special meanings, so you'll need to escape them (with a backslash) to match them literally.

Hugo

<< CafePress for the UK (again) Trivial, I thought. >>
View Comments (Flat Mode) Printer Version
linux 'find' command Bruce Ure - 6/08
    Re: linux 'find' command Bruce Ure - 6/08
    Re: linux 'find' command David Crowson - 6/08
    Re: linux 'find' command Hugo van der Sanden - 6/08
       Re: linux 'find' command David Crowson - 6/08
          Re: linux 'find' command Hugo van der Sanden - 7/08
       Re: linux 'find' command Bruce Ure - 6/08
          Re: linux 'find' command Hugo van der Sanden - 7/08
             Re: linux 'find' command Bruce Ure - 8/08
                Re: linux 'find' command Hugo van der Sanden - 9/08
                   Re: linux 'find' command Simon - 9/08
                      Re: linux 'find' command Hugo van der Sanden - 9/08
             Re: linux 'find' command Rob Larsen - 4/08
                Re: linux 'find' command Simon - 7/08