getopts
getopts
while getopts ":abc" opt; do
case $opt in
a)
echo "Option -a was specified."
;;
b)
echo "Option -b was specified."
;;
c)
echo "Option -c was specified."
;;
*)
echo "Unknown option: $opt"
;;
esac
donehelp
breakdown
Last updated