1

Combine options and arguments in BASH script

view story
linux-howto

http://stackoverflow.com – My Bash-Script should accept arguments and options. Moreover arguments and options should be passed to another script. The second part I've solved: for argument in "$@"; do options $argument done another_script $ox $arguments function options { case "$1" in -x) selection=1 -y) selection=2 -h|--help) help_message;; -*) ox="$ox $1";; *) arguments="$arguments $1";; esac } Now I don't know how to implement an argument "-t" where the user can specify some text It should look something like this: function options { case "$1" in -t) user_text=[ENTERED (HowTos)