LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-04-2004, 05:22 PM   #1
blizunt7
Member
 
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 :
do

commands.....

done


what does.. while :
mean???? thanks so much
josh
 
Old 12-04-2004, 06:19 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,174

Rep: Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784
It is known as a loop. Basically its for repeating commands until the while condition is meet.
http://www.faqs.org/docs/abs/HTML/loops.html
http://tille.soti.org/training/bash/ch09s02.html
 
Old 12-04-2004, 06:25 PM   #3
blizunt7
Member
 
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, 06:27 PM   #4
zhangmaike
Member
 
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.
 
  


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


All times are GMT -5. The time now is 01:58 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration