Go Job Hunting at the LQ Job Marketplace
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 12-04-2004, 04:22 PM   #1
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Rep: Reputation: 30
while loops + while :

hey all,

i recently saw in a script:

while :



what does.. while :
mean???? thanks so much
Old 12-04-2004, 05:19 PM   #2
Registered: Aug 2002
Posts: 13,018

Rep: Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029
It is known as a loop. Basically its for repeating commands until the while condition is meet.
Old 12-04-2004, 05:25 PM   #3
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Original Poster
Rep: Reputation: 30
haha, sorry i should have specified. I am well aware of what a loop is.

the colon after the while statement, is what i am interested in.
I saw this in a script. just curious what it menas.
thanks again
Old 12-04-2004, 05:27 PM   #4
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
The : is a null command. The while loop loops until the command after the "while" keyword returns a non-zero exit code. : always returns 0, so this is an infinite loop.


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
ksh and while loops pdc Linux - Newbie 2 10-29-2005 04:13 PM
variable with while loops michael_util Programming 4 08-16-2004 12:07 PM
foreach loops chunky Linux - General 2 07-02-2004 11:49 AM
loops JMK Linux - Newbie 11 04-09-2004 05:30 PM
Functions And Loops petercool Programming 14 08-08-2003 10:35 AM

All times are GMT -5. The time now is 09:51 AM.

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