を使用してファイルをダウンロードしようとしていますがwget
、進行状況をログ ファイルに保存したいと考えています。
wget http://unfccc.int/resource/docs/convkp/kpeng.pdf -O amit.pdf 2> amit.log
これはwgetが返すものです:
Connecting to unfccc.int (unfccc.int)|62.225.2.55|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 76721 (75K) [application/pdf]
Saving to: `amit.pdf'
0K .......... .......... .......... .......... .......... 66% 2.29M 0s
50K .......... .......... .... 100% 9.41M=0.02s
2013-08-28 12:24:32 (3.06 MB/s) - `amit.pdf' saved [76721/76721]
grep を使用して、最後の行からパーセンテージ値を取得したいと考えています。これは、機能しない上記のコマンドと一緒に使用したものです。
| grep "(\d+(\.\d+)?(?=%)" amit.log
sed と awk を使用せずに grep のみを使用することは可能ですか?