[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

nested ifs in korn shell scripting

Posted on 2008-01-29
2
Medium Priority
?
6,514 Views
Last Modified: 2013-12-26
I want to write nested if statement in korn Shell script

if
then
----
elif
then
----
within the elif I want to write another if statement

else

---
fi

Please advise.
0
Comment
Question by:saibsk
2 Comments
 
LVL 85

Accepted Solution

by:
ozo earned 2000 total points
ID: 20773468
if condition
then
----
elif condition
then
   if condition
   then
   else
   fi
fi
0
 
LVL 14

Expert Comment

by:sentner
ID: 20773643
To clarify ozo's code block.  You don't need to do anything special.  You can nest if's just as in other languages.  
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

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

This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

612 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