LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-22-2003, 02:16 PM   #1
thepryme
LQ Newbie
 
Registered: Oct 2003
Posts: 6

Rep: Reputation: 0
Moving back to top in script


If i set up a script like this

read name:
echo "Your name is $name"
echo "Is this correct?"
read $correct

case in $correct

y)
echo "Welcome $name"
;;

n)
*** I want this to go back to the read name portion of the script***
;;

*)
*** I want this to go back to the read correct portion of the script ***
 
Old 10-22-2003, 02:42 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,938

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Is this any help:
http://docsrv.caldera.com:8457/en/AdvBashHowto/
 
Old 10-22-2003, 02:43 PM   #3
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
correct=n
while [ "$correct" != "y" ]
do
read name
echo ...
read correct
case $correct in
y) echo welcome $name ;;
*) echo please enter correct name ;;
esac
done
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving back an rpm packages revision louisb Linux - Enterprise 3 07-09-2005 05:24 AM
Moving back to Xfree 3.3.6 mazebane Amigo 6 11-29-2004 03:42 PM
How to get back to the desk top after CTRL +ALT+F1 wisdom Linux - Software 6 02-14-2004 05:10 AM
openbsd: moving windows w/out using top bar yocompia *BSD 2 10-28-2003 09:40 AM
Moving swap back to main memory acid_kewpie Linux - General 4 08-26-2001 10:40 AM


All times are GMT -5. The time now is 10:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration