if Conditional Statement in Shell Script
courtesy-byterevel.com |
Bash shell Script also provide if-else conditional statement like other programming languages. If-else statement helps to evaluate perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.
There are three different if-else forms provided by shell script
1. if-else-fi
2. if-fi
3. if-elif-else-fi
1. if-else-fi
if condition
then
then
perform some action
elseperform other action
fi2. if-fi
if condition
then
then
perform some action
fi3. if-elif-else-fi
if condition
then
then
perform some action
elif condition then perform 2nd action
elseperform other action
fiIf You Liked This Post Please Take a Time To Share This Post
0 comments:
Post a Comment