Created
March 23, 2019 08:49
-
-
Save hustlijian/8c73443b873eaa08bc4e5d6eda5c0dbb to your computer and use it in GitHub Desktop.
bash handle input aprameter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while [ "$1" != "" ]; do | |
case $1 in | |
-s ) shift | |
SERVER=$1 ;; | |
-d ) shift | |
DATE=$1 ;; | |
--paramter|p ) shift | |
PARAMETER=$1;; | |
-h|help ) usage # function call | |
exit ;; | |
* ) usage # All other parameters | |
exit 1 | |
esac | |
shift | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment