如何在处理完每个页面后向循环添加 10 秒睡眠?
#!/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
#!/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
应该管用