$ perl -ne '/2001.*\/en\// && print' < 2001.log
You don't need cat here. That line assumes lines with the 2001 before
the /en/, though.
Ar an 4u la de mi 10, scriobh Declan Grady :
> And again, my shell wont do it !!!
>
> vweb$ cat 2001.log | perl -ne '/\/en\// && print'
> bash: cat: command not found
> vweb$
>
> Oh what fun !
>
> I think what I was doing was working ok, so I did a script :
>
> perl -e 'open(I,"/logs/access.www.nuvotem.com");while(<I>){print $_
> if($_=~/2001/);}' >/tmp/2001.log
> perl -e 'open(I,"/tmp/2001.log");while(<I>){print $_ if($_=~/GET\
> \/en\//);}' >/tmp/2001en.log
> gzip /tmp/2001.log
> gzip /tmp/2001en.log
>
> .. so this gives me manageable files to take down my 64K isdn line !
>
> Can I pipe the result of the first command into the second ? or can I match
> both terms in one ?
> i.e. Give me all the lines that have "2001" and "GET /en/" in them ?
>
> (Said he, polishing his newbie hat)
>
> Thanks for all the suggestions folks,
> Declan
> [NODIS]
--
`... when the elephant man broke strong men's necks, when he'd had too
many Powers, ...'
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!