Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

foreach loop

Status
Not open for further replies.

JTan

Technical User
Oct 9, 2001
73
SG
Hi,

may I know whether foreach loop exists for ksh?

If it doesn't, may I know what other shells would have foreach loop?

TIA....
 
Hi JTan,

There three basic loop constructs in Korn shell scripting:
1) for loops
eg:
for <variable> in <word> [<word> ... ]
do
<commands>
done

2) while loops
eg:
while <command>
do
<commands>
done

3) until loops
eg:
until <command>
do
<commands>
done

But try the man pages (man ksh) on the flavour of UNIX you are using for further details. For the other shells, see their man pages.

I hope that helps.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top