mirror of
https://github.com/dunwu/linux-tutorial.git
synced 2024-04-15 19:55:24 +08:00
15 lines
272 B
Bash
15 lines
272 B
Bash
#!/usr/bin/env bash
|
|
|
|
# extracting command line options as parameters
|
|
|
|
while [ -n "$1" ]
|
|
do
|
|
case "$1" in
|
|
-a) echo "Found the -a option" ;;
|
|
-b) echo "Found the -b optins" ;;
|
|
-c) echo "Found the -c optins" ;;
|
|
*) echo "$1 is not a valid options" ;;
|
|
esac
|
|
shift
|
|
done
|