GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Operating System  >  Shell Scripting
Go To First  |  Previous Question  |  Next Question 
 Shell Scripting  |  Question 4 of 47    Print  
What are the different kinds of loops available in shell script?

  
Total Answers and Comments: 5 Last Update: January 05, 2010   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 03, 2005 07:57:42   
shiv        

RE: What are the different kinds of loops available in shell script?
for if while case
 
Is this answer useful? Yes | No
June 03, 2005 12:50:43   
joadavis        

RE: What are the different kinds of loops available in shell script?
if and case are not loops but rather control structures.
until is also used with the while keyword
I checked in KornShell Programming Tutorial by Barry Rosenberg to be sure this is right.

 
Is this answer useful? Yes | No
July 05, 2005 01:02:11   
abhay        

RE: What are the different kinds of loops available in shell script?
Broadly categorised in 3
for
while
until

 
Is this answer useful? Yes | No
December 11, 2009 13:33:10   
kabhishek Member Since: December 2009   Contribution: 1    

RE: What are the different kinds of loops available in shell script?
3 loops

for
while
until --> Just reverse of while loop

-----------------------
"if-elif" or "if else" or "case" not comes in the loop

 
Is this answer useful? Yes | No
January 04, 2010 06:10:02   
amverma10 Member Since: January 2010   Contribution: 1    

RE: What are the different kinds of loops available in shell script?
While loop
The syntax for while is:
while condition
do
statements...
done

For loops
The syntax for the for loop:
for name [in list]
do
statements that can use $name...
done
Untill loops
The until construct works almost exactly the same as while. The only difference is that until executes the body of the loop so long as the conditional expression is false whereas while executes the body of the loop so long as the conditional expression is true. Think of it as saying "Execute until this condition becomes true."

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape