8

How can I add a 10sec sleep to my loop after each page is processed?

#!/bin/sh

for page in {1..50}
do
    wget -q -U Mozilla "http://admin.domain.com/products_search/?p=$page" -O - \
    | tr '"' '\n' | grep "^Product photo for " | cut -d ' ' -f 3 > bproduct.txt
done
1
  • 2
    Hint: apropos sleep; man 1 sleep
    – alex
    Feb 7 '11 at 19:34
21
#!/bin/sh

for page in {1..50}
do
    wget -q -U Mozilla "http://admin.domain.com/products_search/?p=$page" -O - \
    | tr '"' '\n' | grep "^Product photo for " | cut -d ' ' -f 3 > bproduct.txt
    sleep 10
done

Should work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.