pipe multiple files (gz) into c program,

Posted by monkeyking on Stack Overflow See other posts from Stack Overflow or by monkeyking
Published on 2010-03-20T22:39:10Z Indexed on 2010/03/20 22:41 UTC
Read the original article Hit count: 283

Filed under:
|
|
|
|

Ive written a cprogram that works when i pipe data into my program using stdin like

gunzip -c IN.gz|./a.out

If I want to run my program on a list of files I can do something like

for i `cat list.txt`
do
  gunzip -c $i |./a.out
done

But this will start my program 'number of files' times. I'm interested in piping all the files into the same process run.

Like doing

for i `cat list.txt`
do
  gunzip -c $i >>tmp
done
cat tmp |./a.out

thanks.

© Stack Overflow or respective owner

Related posts about c

    Related posts about c++