In this section, we will recognize shell decision-making in UNIX. While writing a shell script, there may be a condition when you require adopting one path out of the given two paths. So you want to make use of conditional statements that allow your program to make accurate decisions and perform the right performance.
Unix Shell supports conditional statements which are used to execute different actions based on different conditions. We will now realize two decision-making statements here −
If else statements are useful decision-making statements which can be used to choose a decision from a given set of options.
Unix Shell supports following forms of if…else statement −
Most of the if statements check associations using relational operators discuss in the previous section.
You can use many if...elf statements to execute a multiday branch. However, this is not always the best solution, especially when all of the branches depend on the value of a single variable.
Unix Shell supports case...sac statement which handles right this situation, and it does so more efficiently than repeated if...elf statements.
There is only one form of case...sac statement which has been describe in specify here −
The case...sac statement in the UNIX shell is much related to the switch...case statement we have in other programming languages like C or C++ and PERL, etc.
Unix/Linux Related Interview Questions
|Perl Scripting Interview Questions||Shell Scripting Interview Questions|
|Python Interview Questions||Core Java Interview Questions|
|Linux Interview Questions||Linux Embedded systems Interview Questions|
|Red Hat Linux System Administration Interview Questions||IBM AIX Interview Questions|
|Sybase Interview Questions||IBM AIX 7 Administration Interview Questions|
|Unix Shell Scripting Interview Questions||Linux Shell Scripting Interview Questions|
Unix/Linux Related Practice Tests
|Perl Scripting Practice Tests||Shell Scripting Practice Tests|
|Python Practice Tests||Core Java Practice Tests|
|Linux Practice Tests||Linux Embedded systems Practice Tests|
|Red Hat Linux System Administration Practice Tests||IBM AIX Practice Tests|
|Sybase Practice Tests||IBM AIX 7 Administration Practice Tests|
|Autosys Practice Tests|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.