Uncompress and pipe the output to script
43,033
I found the solution:
gunzip -c myfile.gz | myScript.pl -o myoutfile.txt -i -
it was the -
after -i
that did the trick.
Related videos on Youtube
Author by
crysis405
Updated on September 18, 2022Comments
-
crysis405 almost 2 years
I have a script that takes an input with a
-i
flag. The input file I have is compressed (.gz). What I want to do (not sure it's possible), because the file is huge, do some thing like this:gunzip -c myfile.gz | myScript.pl -i STDIN -o myoutfile.txt
So pipe the output of the decompression to my scripts input flag.
-
web.learner over 10 yearsAnd your question is?
-
crysis405 over 10 yearsthat command I wrote doesn't work, I want something that will
-
crysis405 over 10 yearssorry about the space, that should not be there. The script is now giving me an error that I haven't provided an input. Does this have to be specifically specified in the perl script, if you want to do piping like this?
-
-
mpen over 4 yearsTo other readers,
-c
is for "to stdout"