We help IT Professionals succeed at work.

while read ID; do

Mehran Goudarzi
on
304 Views
Last Modified: 2018-02-06
i have loop script :
while read ID; do 
curl -X -d "http://localhost/inst/vendor/mgp25/yekk-php/index2.php?media_id="$ID"&submit=Submit"
sleep 3
done < ~/Desktop/scripts/yekk/ids.txt

Open in new window


This work well , now i want my script make counter and it print how many times it try to send it .
Comment
Watch Question

Subrat (C++ windows/Linux)Software Engineer
CERTIFIED EXPERT

Commented:
keep a variable and increment inside the loop for each iteration.
out side loop, you can print it to know the count

Author

Commented:
i want  do it when This response sent from Server  
string(2) "ok"

Open in new window

and then count it .
Application Development and Automation Management
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
So good Thanks .
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.