A little more sophisticated script than the former bash menu example to get some arguments from command line.
bash |copy code |?
01 #!/bin/bash02 03 04 05 while getopts "u:p:" opt; do06 07 case $opt in08 u)09 echo "-u was triggered, Parameter: $OPTARG"10 dbuser="$OPTARG"11 ;;12 p)13 echo "-u was triggered, Parameter: $OPTARG"14 dbpass="$OPTARG"15 ;;16 \?)17 echo "-u was triggered, Parameter: $OPTARG"18 exit 119 ;;20 \?)21 echo "-u was triggered, Parameter: $OPTARG"22 exit 123 24 25 ;;26 27 esac28 29 30 31 done32 33 # Clear all options and reset the command line34 shift $(( OPTIND -1 ))