I have this program that takes one argument for the source file and then it parse it. I have several files gzipped that I would like to parse, but since it onl开发者_JAVA百科y takes one input, I'm wondering if there is a way to create one huge file using gzip and then pipe it into the only one input.
Use zcat
- you can provide it with multiple input files, and it will de-gzip them and then concatenate them just like cat
would. If your parser supports piped input into stdin, you can just pipe it directly; otherwise, you can just redirect the output to a file and then invoke your parser program on that file.
If the program actually expects a gzip'd file, then just pipe the output from zcat to gzip to recompress the combined file into a single gzip'd archive.
http://www.mkssoftware.com/docs/man1/zcat.1.asp
精彩评论