循环并追加/写入同一文件而不覆盖

PoG*_*bas 0 shell loops

for num in {1..5}
do
perl simulate.pl file.txt file2.txt > output.txt
done
Run Code Online (Sandbox Code Playgroud)

但我的输出每次都被覆盖.我知道他们应该是一个我不知道的简单答案.

Ign*_*ams 7

要么在每次迭代时追加,要么在最后覆盖.

> output.txt
for num in {1..5}
do
  perl simulate.pl file.txt file2.txt >> output.txt
done
Run Code Online (Sandbox Code Playgroud)

for num in {1..5}
do
  perl simulate.pl file.txt file2.txt
done > output.txt
Run Code Online (Sandbox Code Playgroud)