RS6
Member
Registered: 5th Nov 03
Location: with MJ
User status: Offline
|
Trying to get this loop to work, i used it before for some coursework worked then but not now?
any ideas its unix just for inputting a name into a script
echo "Please Type in your Name & Press the Enter Key"
read username
echo ""
echo "Is the above information $username correct Press 1 for YES & 2 for NO?"
read answer3
until [ answer3 -ne 2 ]
do
if [ answer3 -eq 2 ]
then
echo "PLEASE RE-ENTER YOUR NAME DETAILS"
read username
echo""
echo "Is the Above information $username correct press 1 for YES and 2 for NO"
read answer3
fi
done
if [ answer3 -eq 1 ]
then
echo "Choice Accepted"
echo ""
fi
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
What shell was it written for, and what is your shell now?
|
RS6
Member
Registered: 5th Nov 03
Location: with MJ
User status: Offline
|
KSH, for unix shell script written in jpico
|
Tim
Site Administrator
Registered: 21st Apr 00
User status: Offline
|
Works fine for me, except I don't exactly agree with your logic above (think there's better ways of writing it)...
What is not working for you?
|
Jules
Member
Registered: 26th Nov 04
Location: Ipswich, Suffolk Status: Happy
User status: Offline
|
10 print "U R The L33t"
20 goto 10
Run
I think that should solve it
|