I was playing with bash programming. I have written a simple bash program which takes input from reader. If reader typed the string "bye" the while loop ends. So the program is pretty simple I have written something like this
#!/bin/sh
inputString="hello"
while [ inputString != "bye" ]
do
echo "Please write something (bye to quit)"
read inputString
echo "You typed : ${inputString}"
done
It works perfectly until user type two words at a time.
If user type something like this
bye bye
Program crashes giving the following error
./WhileLoop.sh: 5: [: bye: unexpected operator
How can i modify the code so that program can take multiple input?