[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: parallel cat
From: |
Rhys Ulerich |
Subject: |
Re: parallel cat |
Date: |
Sun, 17 Jul 2011 09:12:40 -0500 |
Hi Dan,
> I usually use "cat pe* > diag" ...
> Basically the resulting diag file only contains one of the input files.
> ...
> parallel "cat {} >diag_amsua_n18_03.2011041700" ::: pe*
Try >> instead of >. This will cause each cat to append to the file
rather than each cat to overwrite the file.
As an example, generate some data in a bunch of different files
parallel echo '{} >> dat{}' ::: `seq 1 100`
parallel echo '{} >> dat{}' ::: `seq 1 100`
parallel echo '{} >> dat{}' ::: `seq 1 100`
followed by appending it all to a single file
parallel 'cat {} >> foo' ::: dat*
and then you can confirm with 'wc -l foo' that foo contains 300 lines
as expected.
Using > causes only the last cat to 'win'.
- Rhys