Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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.

    emc

    " 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.

    Cheers,

    JohnGG

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2015-07-30 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls