Okay using vi editor regular vi not VIM or any other hybrid.
What I'm trying to do is make a simple script in the csh. By the way what's better csh or sh for scripting? It's been a while since I did vi scripting....Anyway here's the purpose of the script.
I want to be able to give the script a "yes" answer and a "no" answer.....The yes answer will exit out of the script, and the no answer will cause the program to loop with an echo of "Do you want to exit" reading the answer everytime to check for yes or no. My problem is that the program reads the answer but no matter what answer I give the script it exits out of the script after it finishes echoing what I told it to. I can't get it to do what I want and need a bit of help....Here's the script...I know super basic I feel dumb. Here it is:
\#/bin/sh if [ "$answer" = "" ]; then read answer while answer=n; do echo "Do you want to exit" read answer if answer=y; then exit fi done fi