Bash Standard Command Line Option Processing Pattern: Difference between revisions
Jump to navigation
Jump to search
m (Ovidiu moved page Bash Command Line Options Processing to Bash Standard Command Line Option Processing Pattern without leaving a redirect) |
|||
Line 2: | Line 2: | ||
* [[Bash#bash_Script_Library|bash]] | * [[Bash#bash_Script_Library|bash]] | ||
* [[Bash Processing of Command Line Parameters that Include Spaces|Processing of Command Line Parameters that Include Spaces]] | |||
=Overview= | =Overview= |
Latest revision as of 19:27, 13 May 2019
Internal
Overview
while [[ -n $1 ]]; do
if [[ $1 = "--verbose" ]]; then
# no value
....
elif [[ ${1:0:7} = "--type=" ]]; then
# value expected
type=${1:7}
...
else
echo "unknown argument $1" 1>&2
fi
shift
done