?
Solved

if then else nested loop structure

Posted on 2004-11-22
3
Medium Priority
?
590 Views
Last Modified: 2012-05-05
unix script on aix 4.3
what is the structure for a nested loop
if then else
if then else
thanks
Jeff
0
Comment
Question by:urbanweasel
3 Comments
 
LVL 11

Assisted Solution

by:griessh
griessh earned 75 total points
ID: 12647453
Hi urbanweasel,

If you use ksh the syntax is:

if <compound list>
then <compound list>
elif <compound list>
then <compound list>
.
.
.
else <compound list>
fi

======
Werner
0
 
LVL 48

Accepted Solution

by:
Tintin earned 75 total points
ID: 12651143
A nested loop looks something like:

while true
do
   while true
   do
       :
   done
done

A nested conditional, looks something like:

if [ condition [
then
      if [ condition ]
      then
            : # true
      else
            : # false
       fi
else
     : # false
fi
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 12686943
sounds like a homework
Could you please explain what you mean by:
 >   unix script

and if you want to know something about loops:
 >   what is the structure for a nested loop

or condistions:
>   if then else
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question