This is the shell code I am running:
#!bin/bash
while true
do
req=$(curl http://localhost/devcalls/camerarequest.php)
if [ "$req" == "1" ]
then
sudo bash /home/ckoy-admin/HAS_system/camera/cam.sh
fi
done
and this is the error I get when I execute:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1 100 1 0 0 56 0 --:--:-- --:--:-- --:--:-- 58
CAM.sh: 7: [: 1: unexpected operator
Please let me know what is wrong here.
vi?echo "$req" | hexdump -C. Check your file for special characters withcat -A fileorcat -v file.sh CAM.sh, andshis a shell (probablydash) that doesn't recognize==as a valid operator with the[command.==to-eqworked!