Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2017-12-17 18:00 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (466 votes). Check out past polls.