2009年5月1日金曜日

wget で取得した内容を標準出力

メモエントリ
 

wget -O - 'http://sawano.members.icraft.jp/'

wget の "-O" オプションは、取得した内容を引数に指定したファイルに保存する。
 

このとき ファイル指定の変わりに "-" ハイフン一丁指定してあげると、標準出力にでてくる。
 
 

ちょいと man を引用
-O file
--output-document=file
The documents will not be written to the appropriate files, but all will be concatenated
together and written to file. If - is used as file, documents will be printed to standard
output, disabling link conversion. (Use ./- to print to a file literally named -.)
 
Note that a combination with -k is only well-defined for downloading a single document.

 

使いどころは限定的、動作確認とか。