Uncompress and pipe the output to script

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.

5

1 Answer

I found the solution:

gunzip -c myfile.gz | myScript.pl -o myoutfile.txt -i -

it was the - after -i that did the trick.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like