EpiMan
EpiMan

Reputation: 839

pipe two files as inputs of an script in linux command line

I have 2 *.gz files. I want to cat them (zcat) and pipe them to a command as its inputs.

zcat file1.gz
zcat file2.gz

then pipe them in order as input

| script file1 file2  > 

Upvotes: 3

Views: 2332

Answers (1)

klau
klau

Reputation: 66

If you're using bash or zsh, you can do this:

script <(zcat file1.gz) <(zcat file2.gz)

It's a bit more difficult otherwise, and I would probably use named pipes.

Upvotes: 5

Related Questions