LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-02-2004, 01:33 PM   #1
Diamond Jester
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Rep: Reputation: 0
Do while loop in Linux?


I have been using while loops in Linux and now I want to try to use a do while loop, but I dont know how can someone tell me what I need to do please?
 
Old 11-02-2004, 01:37 PM   #2
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
linux is not a language -- there is no way to 'use while loops in linux'

-- you can use while loops in scripts, which can be interperted by the shell you are using, but that is another issue.

--please be more exact about where you use your loops, so we can accuratly advise you on proper syntax

--general info on do/while loops:
they're a while loop, but they execute a minimum of one time -- they loop before they check the condition for looping...
 
Old 11-02-2004, 01:42 PM   #3
Diamond Jester
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Ok Im using a telnet for redhat linux. Im creating a script(bash shell I believe) and I would like to use a do while loop. My loop is to check if there are any users names who need to be input after the firts name has been input.
 
Old 11-02-2004, 03:40 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
This link explains all of the bash looping constructs.
 
Old 11-02-2004, 04:13 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
http://www.tldp.org/LDP/abs/html/loops1.html
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell variable in Linux is reset after while loop CBenner Programming 7 05-19-2006 09:46 AM
Linux scripting - wget loop northy_ie Programming 7 11-09-2005 08:17 AM
Linux Infinite Reboot Loop SNunweiler Linux - Software 2 05-10-2005 12:31 PM
while to need while loop at /etc/init.d/rcS in embeded linux to start QT alice95089 Linux - Laptop and Netbook 2 12-09-2004 09:25 PM
Linux Boot stuck in endless loop. gbarcalo Linux - Software 1 12-03-2003 01:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:33 PM.

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
Open Source Consulting | Domain Registration