Skip to content

Instantly share code, notes, and snippets.

@asvid
Last active May 3, 2020 11:13
Show Gist options
  • Select an option

  • Save asvid/d2882cdd9cbc9860ef7f327a4e777b99 to your computer and use it in GitHub Desktop.

Select an option

Save asvid/d2882cdd9cbc9860ef7f327a4e777b99 to your computer and use it in GitHub Desktop.
OTHER_ARGUMENTS=()
ARG_A=false
for arg in "$@"
do
case $arg in
-h)
Help
exit;;
-a)
ARG_A=true
shift;;
-p|--path)
ARG_PATH=$2
shift
shift
;;
*)
OTHER_ARGUMENTS+=("$1")
shift;;
esac
done
echo -e "${ARG_A}"
echo -e "${ARG_PATH}"
echo -e "${OTHER_ARGUMENTS[*]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment