LoginSignup
9
5

More than 5 years have passed since last update.

curlで同じURLをループして叩くshellスクリプト

Last updated at Posted at 2017-01-26
curl_loop.sh
#!/bin/sh

URL="http://api.example.com/v1/hogehoge.json"; #接続先
HEAD="Content-Type:text/xml"; #リクエストヘッダー
DIR="."; #結果保存先ディレクトリ

for i in {0..100}
do
    SETDT=`date "+%Y%m%d%H%M%S"`
    curl -H $HEAD $URL > $DIR/$SETDT.txt;
    sleep 1;
done
9
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
5