[Gllug] Combining CAT and ZCAT in one line

- Tethys tethys at gmail.com
Tue Jul 10 10:21:24 UTC 2007


On 7/10/07, Andrew Black <andrew-li at black1.org.uk> wrote:

> I can do
>     cat mainlog       | grep oojimaflip
>     zcat mainlog.*.qz | grep oojimaflip
>
> Is there are way I can do both in the same line - decompress files that
> need it  on the fly ?

Ditch the unnecessary cat, and just use zgrep, which works with both
compressed and uncompressed files.

Tet

-- 
Perl is like vise grips. You can do anything with it but it is the
wrong tool for every job. -- Bruce Eckel
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list