日: 2019年6月22日

  • watch curl時にダウンロード状況を出さない

    watch curl時にダウンロード状況を出さない

    はじめに

    curlをwatchコマンドでポーリングしたい場合がある。しかし、
    普通に実施すると、ダウンロード進捗状況が表示されてしまう。

    watch curl http://hogehoge.com/version

    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 199 100 199 0 0 199 0 0:00:01 --:--:-- 0:00:01 33166

    対処

    curlには “` -s “` という進捗を表示しないモードがある。

    watch curl -s http://hogehoge.com/version