Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: dynamic zcat and grep

by clmcshque (Initiate)
on Mar 21, 2006 at 22:38 UTC ( #538332=note: print w/ replies, xml ) Need Help??

in reply to Re: dynamic zcat and grep
in thread dynamic zcat and grep

Thanks for the reply. I've tried many different encarnations of that line:

open(INFILE, "zcat $filename |") open(INFILE, 'zcat $filename |') open INFILE, "zcat $filename |"
all with the similar results.
zcat: compressed data not read from a terminal. Use -f to force decomp +ression. For help, type: zcat -h

Comment on Re^2: dynamic zcat and grep
Select or Download Code
Replies are listed 'Best First'.
Re^3: dynamic zcat and grep
by swampyankee (Parson) on Mar 22, 2006 at 03:29 UTC

    Sorry my help was not helpful.

    I've looked at the docs for zcat (well, OpenBSD's docs for zcat) and it seems that your first and third choices should work: zcat unzips the input file to STDOUT. When I get a chance (probably about 24 hours from now), I'll muck about on by OpenBSD box to see if I can replicate your results.


    " The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents."
    —Nathaniel S. Borenstein
Re^3: dynamic zcat and grep
by johngg (Abbot) on Mar 22, 2006 at 11:23 UTC
    Can you use your zcat in a pipe on the command line? Like

    % cat file.gz | zcat | less

    This works on Solaris but if it doesn't work for you it could be that your zcat demands the presence of a terminal as implied by your results.



      On the command line I use:
      $ zcat file.gz | grep ...
      Which works just fine. Is that the same?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://538332]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2015-11-28 15:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls