I have sorted, gzipped files in a directory. How to combine some of them into another sorted, gzip file? I'm using explicit fifa right now. Is there any way to do this in bash without? I am a little bash noob, so please excuse my style.
#!/bin/bash
for f in $@
do
mkfifo $f.raw
gzcat $f > $f.raw &
done
sort -mu *.raw | gzip -c
rm -f *.raw
I want to convert this to something like ...
sort -mu <(gzcat $1) <(gzcat $2) <(gzcat $3) ... | gzip -9c
... but I donβt know how to do it. Do I need a loop building parameters for a string? Is there any magic shortcut for this? Maybe map gzcat $@?
NOTE. Each of the files exceeds 10 GB (and 100 GB unzipped). I have a 2 volt drive, so this is not a problem. In addition, this program MUST run in O (n), or it becomes impracticable.