terminal - Shell line 7: [14: command not found -
this question has answer here:
i don't know problem fix here code:
#!/bin/sh while true hour=$(date '+%h') target=16 echo $hour if [$hour -gt $target]; mail -s "ip" "example@hotmail.com" <<eof global_ip=$(curl -s checkip.dyndns.org | sed -e 's/.*current ip address: //' -e 's/<.*$//') eof echo "sent" fi echo "waiting..." sleep 3600 echo "done waiting" done
please help!
you have add blanks after [
, before ]
:
if [ $hour -gt $target ];
Comments
Post a Comment