Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  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
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
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910


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 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 > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:59 PM.

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