我需要编写一个脚本来说明给定网站(第一个参数)是否已更改。我写了类似的东西,但它不起作用并且无法继续找到错误
#!/bin/bash
website=$1
time=$2 #frequency of checking the page
x=1
spr=$(diff -s ttt.txt ttt1.txt)
lynx -dump $website | cat > ttt.txt ttt1.txt
until [ 1 -eq 0 ]; do
sleep $2
lynx -dump $website | cat > ttt1.txt
if [ "$(diff -s ttt.txt ttt1.txt)" = "$spr" ]
then
lynx -dump $website | cat > ttt.txt
echo "Changes were made "
else
echo "No changes"
fi
done