bashを使用してファイルを1行ずつ追加しますか?

bashを使用してファイルを1行ずつ追加しますか?

現在、私は結合されたファイルに内容を追加するために複数行を使用しています。

./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

1行に置き換えることができますか?

ベストアンサー1

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

おすすめ記事