我有一个带有 while 循环的 shell 脚本,它没有退出。该wget
语句将返回我true
或false
. 我需要执行表扬,直到值为true
#!/bin/bash
status="false";
while [ "$status" != true ]
do
status=`wget -q -O - http://server`
echo $status
echo "Sleeping for 5 sec";
sleep 5;
done
输出:
false
Sleeping for 5 sec
false
Sleeping for 5 sec
true
Sleeping for 5 sec
true
Sleeping for 5 sec
true
.............