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

Re: scripting question



On Wed, Apr 16, 2003 at 05:00:34PM +0100, Colin Watson wrote:
> On Wed, Apr 16, 2003 at 05:44:04PM +0200, David Jardine wrote:
> > On Wed, Apr 16, 2003 at 02:05:52PM +0100, Colin Watson wrote:
> > > On Wed, Apr 16, 2003 at 03:40:42PM +0200, David Jardine wrote:
> > > > Well,
> > > > 
> > > > 	grep foo "ignore\|this\|and\|that" -v
> > > > 
> > > > works for me but
> > > > 
> > > > 	grep foo 'ignore\|this\|and\|that' -v
> > > > 
> > > > doesn't.
> > > 
> > > Neither of those is right anyway (you've got the pattern and the
> > > filename the wrong way round), so perhaps you could paste exactly what
> > > you're doing?
> > 
> > Oops, sorry.  Yes, I did get them wrong way round.
> > Nevertheless,
> > 
> > 	zcat logs.gz|grep "200\|302\|304" -v|...
> > 
> > or something similar does enable me to isolate odd 
> > entries, whereas single quotes, with or without the 
> > backslashes, don't work.
> 
> How odd. Try using 'echo' to see what the difference is in what's being
> passed to grep, since the above should be identical with '...' and
> "...".
> 

My apologies.  I could have sworn etc etc... :-(

With or without echo `...` , with single or double 
quotes, it all works.  I think I must have tried the 
variations of the above command as is (it's just a 
simplification of what I would really do), but of course 
the year 2003 (with the string 200) appears in all the 
lines and so it returns nothing.


> -- 
> Colin Watson                                  [cjwatson@flatline.org.uk]
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 

-- 
David Jardine
"Running Debian/GNU Linux and
loving every minute of it." -Sacher M.



Reply to: