Quote:
I was wondering how you control read to stay on the previous line. Such as
What is your name: _______
instead of
What is your name:
________
|
Code:
#!/bin/sh
echo -n "What is your name: "
read NAME
echo "Hi, $NAME!"
Quote:
And how would i move back to the appropriate sections with a script like this
read name:
echo "Your name is $name"
echo "Is this correct?"
read $correct
case in $correct
[..snip..]
|
Code:
#!/bin/bash
STOP=0
while [ $STOP == 0 ] ; do
echo -n "What is your name: "
read NAME
echo "Your name is $NAME"
echo -n "Is this correct? "
read CORRECT
case $CORRECT in
"y" | "Y" | "yes" | "YES" | "Yes" )
echo "Welcome $NAME"
STOP=1
;;
"n" | "N" | "no" | "NO" | "No" )
echo "OK, I'll ask again..."
echo
;;
*)
;;
esac
done
echo
You have quite a lot of errors in the code you posted.
Did you really try something yourself?