9

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, 2011 at 19:34

1 Answer 1

20
#!/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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .