So I have this bash script
function exec_do(){
while [[ 1 ]]; do
read _INPUT
if [$_INPUT -eq "exit"]
then
break
else
echo $_INPUT
fi
done
}
The intention is so that if I type in exec_do then it does a while loop which reads the input and do stuff based on the input.
If the input is exit, then it exits the while loop
If the input is not exit then it echoes it
However when I run exec_do
and then type in input
It instead returns input: command not found
And moreover typing in "exit" doesn't break the loop and also return command not found
What did I do wrong and how can I fix this?