syntax of While Loops

#!/bin/sh
while [ comand ]
do
statement to be exeuted if command is true
done

Exemple

#!/bin/sh
INPUT_STRING=hello
while [ "$INPUT_STRING"!="bye" ]
do
echo "please type something in (bye to quit)
read INPUT_STRING
echo "You typed: $INPUT_STRING"
done

Explanation

In this exemple "echo" and read statement run will go forward until we type "bye"
Normaly "while" command execute a code if this expression code is true, and stop only when is false or when say (type) stop.