# Initialize varibles funtimes='' username='' # Setup the function funtimes_function(){ # Check if variable set, and if not prompt for input if [[ ! $username ]]; then read -p "Username: " username; fi # Do stuff echo "hello $username" } # Usage for the hell of it usage(){ echo " Usage: $0 -a -u " } # Run argument parsing while getopts ahu: option; do case "${option}" in a) funtimes=1 ;; u) username=${OPTARG};; h|*) usage; exit 1;; esac done if [[ $funtimes ]]; then funtimes_function else echo "Where all the white women at ?!" fi