ksh loop to read input until QUIT

Hi
I'm looking to write a simple ksh loop reading user input (and write it to a file) until the user enters QUIT at which point I want it to continue.
Does anyone have an example of this type of loop?
Any help much appreciated
Cheers

Hello Grueben,

Could you please try following and let me know if this helps you.

while true; do echo "Enter your choice:"; read var; if [[ "$var" == "quit" ]]; then break;fi; echo $var", I am printing this variable here, you could use it as per your need."; done

Execution and standard output will be as follows.

Enter your choice:
chumma
chumma, I am printing this variable here, you could use it as per your need.
Enter your choice:
singh
singh, I am printing this variable here, you could use it as per your need.
Enter your choice:
quit
 

Thanks,
R. Singh

To save 5 keystrokes typing QUIT, how about this dual key single keystroke:-

#!/bin/ksh
echo "Press Ctrl-D to QUIT and continue..."
cat > /dev/null # /full/path/to/filename
echo "You are here..."

Results using OSX 10.12.5, default bash terminal calling ksh.

Last login: Wed Jul 19 18:55:07 on ttys000
AMIGA:barrywalker~> cd Desktop/Code/Shell
AMIGA:barrywalker~/Desktop/Code/Shell> ./input_txt.sh
Press Ctrl-D to QUIT and continue...
kjsadfkjhkadjf]
)((&%&%^%O*&)
12039809123
';alsd;lkjas/\oiuoeui
You are here...
AMIGA:barrywalker~/Desktop/Code/Shell> exit
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]