※ 引述《liveforlife.bbs@ptt.cc (面對世界的角度)》之銘言:
> 最近想要把time 顯示的時間輸出到檔案,
> 但發現用 > 不能工作,查了之後發現必須用 2>,
> (time ls) > log1 2> log2
> log1 為ls的內容,log2 才是時間。
> -------------------------------------------------------------
> 但我看了time 的說明,其中有一句話如下:
> ......When command finishes, time writes a message to standard
> output giving timing statistics about this program run......
> ---------------------------------------------------------------
> 請教一下各位,為什麼time的輸出是stderr,而非stdout呢? 謝謝!
因為 stdout 是給原本執行程式的訊息輸出用的
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
現代人普遍的現象: 「小學而大遺」、「捨本而逐末」
「以偏而概全」、「因噎而廢食」
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
※ Origin: SayYA 資訊站 <bbs.sayya.org>
◆ From: kendlee.sayya.org