我想我錯過了一些非常愚蠢的東西,請糾正我。如何捕捉'裝載'輸出
[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