标签:break find \n http div htm 使用 echo shel
#! /bin/bash requrl="http://www.baidu.com/xxxxxx" while true do html=$(curl -s "$requrl") url=$(echo "$html" | sed ‘:a;N;$!ba;s/\n//g‘ | sed ‘s/.*URL=//g‘ | sed ‘s/\].*//g‘) if [ ${#url} -gt 0 ];then doname=${url:0:20} myurl="http://www.baidu.com" if [ "$doname" = $myurl ] then requrl=$url echo "`date ‘+%Y-%m-%d %H:%M:%S‘` - find URL:$url" else echo "`date ‘+%Y-%m-%d %H:%M:%S‘` - No Find URL:$url" break fi fi done
标签:break find \n http div htm 使用 echo shel
原文地址:https://www.cnblogs.com/wanglijun/p/10283592.html