Bash – Append files with bash one-liner

bashshellshell-script

Currently I use multiple lines to append content into a combined file, e.g.

./myprogram 1.txt > Out.txt # Overwrite for the 1st file
./myprogram 2.txt >> Out.txt
./myprogram 3.txt >> Out.txt
./myprogram 4.txt >> Out.txt

Is it possible to replace by one-liner?

Best Answer

(./myprogram 1.txt; ./myprogram 2.txt; ./myprogram 3.txt; ./myprogram 4.txt) > out.txt
Related Question