我想我错过了一些非常愚蠢的东西,请纠正我。如何捕捉'装载'输出
[email protected]:~# mount /dev/sdd1 /b 2>&1 > /tmp/test
mount: you must specify the filesystem type
[email protected]:~# cat /tmp/test
[email protected]:~# mount /dev/sdd1 /b > test
mount: you must specify the filesystem type
[email protected]:~# cat test
[email protected]:~#
我只需要捕捉一行输出...谢谢你提前
2>&1发送stderr(2)到**当前**标准输出(1),因此您需要在**之后执行此操作**您已将标准输出重定向到> – joeytwiddle 2012-02-03 03:47:53