LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-04-2004, 04:22 PM   #1
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 274

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, 05:19 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
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, 05:25 PM   #3
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 274

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
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



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

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

All times are GMT -5. The time now is 10:00 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