I have this script start.sh
while[1]
do
read -sn3 key
if [$key=="\033[[A"]
then
./test1
else
./test2
fi
done
I want to set up verification forever, check if the F1 key is pressed. If clicked, run test1 else test2. I started start.sh and worked in the background so that other programs can start.
I got an error while command [1] did not find syntax error near unexpected token 'do' [f == \ 033]: command not found
And where is this read command located? I print what I read, he did not find it.
Also, if try./start.sh and it gives a completely different behavior. I enter the key and it says that the key was not found. Although I run the script in the background
lilzz source
share