Skip to content

Instantly share code, notes, and snippets.

@ghelobytes
Created December 19, 2019 23:43
Show Gist options
  • Save ghelobytes/f031dd7e21cf789f210edc98b65f6697 to your computer and use it in GitHub Desktop.
Save ghelobytes/f031dd7e21cf789f210edc98b65f6697 to your computer and use it in GitHub Desktop.
Passing flagged parameters to bash script
#!/usr/bin/env bash
while getopts u:d:p:b: option
do
case "${option}"
in
u) _USER=${OPTARG};;
p) _PASSWORD=${OPTARG};;
b) _BUILD=${OPTARG};;
esac
done
echo "USER: $_USER PASSWORD: $_PASSWORD BUILD: $_BUILD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment