« 衣酷 | Main | Gnupg 的头疼问题 »

合并bash的标准输出

我想两个程序的输出合并起来存入一个文件或管道,怎么办?
bash下,
${ echo "line1";cat /tmp/file1;echo "end"} >/tmp/file2
注意, {}中的每一个命令后都有;不然会有问题:)

广告

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)