Unix Shell Script Case Statement
May 15, 2007 by Mark Marucot · Leave a Comment
The case statement is similar to if .. else if .. else statement which performs specific statement/s if there are three or more conditions.
Syntax:
CODE:
-
case word in
-
value1) statements
-
value2) statements
-
…
-
*) statements
-
esac
Example:
CODE:
-
!#/bin/sh
-
case $1
-
in
-
1) echo ‘First Choice’;;
-
2) echo ‘Second Choice’;;
-
*) echo ‘Other Choice’;;
-
esac
Unix Shell Script Operators
May 15, 2007 by Mark Marucot · Leave a Comment
The table below shows the list of operators used in conditional statements in Unix scripting.
| Operator | Description | Example |



