mirror of
https://github.com/autistic-symposium/shell-whiz-toolkit.git
synced 2025-05-12 11:42:20 -04:00
some sytem scripts
This commit is contained in:
parent
4b0a965e4a
commit
5852171b21
25 changed files with 639 additions and 1 deletions
18
shell_scripts/lessons/case_loop_example.sh
Executable file
18
shell_scripts/lessons/case_loop_example.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
# script to test case statement
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
r="*** unknown ***"
|
||||
elif [ -n $1 ]
|
||||
then
|
||||
r=$1
|
||||
fi
|
||||
|
||||
case $r in
|
||||
"car") echo "car rental";;
|
||||
"van") echo "van rental";;
|
||||
"jeep") echo "jeep rental";;
|
||||
*) echo "Sorry I have no $r !";;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue