I have been searching for the proper Syntax to a switch statement for Unix SunOS. It seems I'm out of luck, perchance anyone can post an example?
Asked
Active
Viewed 162 times
0
2 Answers
1
In bash there is the case statement
case string1 in
str1)
commands;;
str2)
commands;;
*)
commands;;
esac

user9517
- 115,471
- 20
- 215
- 297
0
The switch statement in bash is called case
. See help case
for details.
case "$1" in
-p) echo 'Hello, world!' ; exit 0 ;;
-h|*) usage ; exit 1 ;;
esace

Ignacio Vazquez-Abrams
- 45,939
- 6
- 79
- 84