Using tee to create a log

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Wayne Conrad
日付:  
題目: Using tee to create a log
On Thu, 26 July 2001, Alan Dayley wrote:
> How does the piped program know that it is piped? I would think that all
> it knows is that it is outputing to sdtout. Who changes the data in the
> pipe? The shell?


The shell doesn't mess with the data. Instead, a program that cares can use an API to find out if its stdin is connected to a pipe, or to a file, or whatever, and then change its behavior accordingly.