My code need compare "stop" with stop this is stand bash string.
pi@raspberrypi:~/Voice $ ./test.sh | more
"stop"
stop
My code:
#!/bin/bash
command=stop
while :
do
QUESTION=$(cat stt.txt) #stt,txt has command "stop"
echo $QUESTION
echo $command
if [ "$QUESTION" == "$command" ]; then
echo "You said "stop"!"
break
fi
done
I had try different command="stop
", the result is same.
I try to put command=$('stop')
, it's okay only one time, then it complains:
./test.sh: line 2: stop: command not found.
I don't know why it is suddenly stop working to set stop as command, not "stop"