Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mmmm...regular expressions. (was Re: Bash shell line continuation)



On Fri, Sep 14, 2001 at 11:49:56AM +0900, brettr wrote:
> grep -vi \.gif ex010905.log | grep -vi \.jpg | grep -vi \.jpeg |     /
>            grep -vi 'googleboot |openfind  > summary.log

I think you meant to say 

  grep -vi '\.gif' .... 

or  

  grep -vi \\.gif ....

Shells eat unquoted or unescaped backslashes, so grep will only see
.gif in your example.

You may also want to use '\.gif\b' instead of '\.gif' -- that way, the
expression will only match .gif at the end of a word, and you won't
drop lines containing words like big.gift.html on the floor. (If you
aren't running Linux, you may have to use egrep instead of grep to get
this feature.)

-- 
Shimpei Yamashita                               http://www.shimpei.org/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links