Last active
May 12, 2016 18:29
-
-
Save tjt263/95bab2a0d42f40547093cb1142e3e9e9 to your computer and use it in GitHub Desktop.
This script is an example of how to use getopts in a shell script. It is intended as a reference for demonstration purposes. Feel free to use it as a style template in scripts of your own.
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
#!/bin/bash | |
while getopts "h" opt; do | |
case $opt in | |
h ) echo "usage: $0 [-h]"; | |
echo "this is just a style template."; | |
exit 0 | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment