计划任务-shell脚本 自动翻页

#!/bin/sh

a_url="http://www.test.com/Crontab/test.html"

http="http://www.test.com"

result=$(echo $a_url | grep "${http}")

file_name="`date +%Y%m%d`.txt"

echo -e "====start_time: `date +%Y%m%d`_`date +%H%M%S`====\n" >> $file_name

while [[ "$result" != "" ]]
do

	echo "get_url:${a_url}" >> $file_name

	a_url=$(curl $a_url);

	result=$(echo $a_url | grep "${http}")

done

echo -e "last:${a_url}\n" >> $file_name
echo -e "=====end_time: `date +%Y%m%d`_`date +%H%M%S`=====\n\n\n" >> $file_name

原文链接: 计划任务-shell脚本 自动翻页 版权所有,转载时请注明出处,违者必究。
注明出处格式:chunkuan ( https://jiachunkuan.com/post-26.html )