回文章列表
作者liveforlife.bbs@ptt.cc (面對世界的角度) 看板: linux
標題[問題] 為什麼 time 的輸出是 standard error output?
時間批踢踢實業 (2008/05/01 Thu 11:59:06)
  最近想要把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呢? 謝謝!

--
※ 發信站: 批踢踢實業坊(ptt.cc) 
◆ From: 140.112.248.169
文章選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻