Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CURL: how to run a single curl command 100 times?

Tags:

curl

I have the following curl command: curl -i -H "Content-Type: text/plain" -X POST -d @hundredencoded http:///aaa/bbb/message

For load testing, i need to run this command 100 times, how do i do it using CURL?

Thanks in advance.

like image 805
user2377310 Avatar asked May 13 '13 10:05

user2377310


1 Answers

You could achieve it by using the below script:

#!/bin/bash

for i in $(eval echo {1..$1})
do 
  curl -i -H 'Content-Type: text/plain' -X POST -d @hundredencoded http:///aaa/bbb/message &  
done
like image 125
qwr Avatar answered Dec 07 '22 13:12

qwr