我是bash的新手,我一生都./fff
无法解决如何在stderr之前运行某个命令,假设并打印常规stdouts(我对自己的含义感到困惑)
例如
$ printf "I am a\ndrill\n" > fff;
$ cat fff nofile fff nofile fff
I am a
drill
cat: nofile: No such file or directory
I am a
drill
cat: nofile: No such file or directory
I am a
drill
需要打印如下:
I am a
drill
I am a
drill
I am a
drill
cat: nofile: No such file or directory
cat: nofile: No such file or directory
我知道我需要先将输出重定向到文件,然后将错误附加到同一文件,但这是我得到的输出
$ cat ./foo nofile ./foo nofile ./foo <<< $(touch fin) > see 2>> see
I am a
drill
I am a
drill
I am a
drill
ectory
cat: nofile: No such file or directory
哦,当我可能弄乱了琴弦。我将立即对其进行编辑@DmitryGrigoryev
—
MeOw
cat
真的将“A”的“一些”?