Search code examples
shellunixpipegunzip

piping the output of gunzip ( of two files ) separately


I have two compressed files. ( file1.gz and file2.gz ). I would like to unzip them and send the output to another command as separate inputs. something like:

gunzip -c file1.gz file2.gz | command -1 file1 -2 file2

How could I achieve this?


Solution

  • You can say:

    command -1 <(gzip -dc file1.gz) -2 <(gzip -dc file2.gz)
    

    You can read more about Process Substitution here.