I have a complex command that I\'d like to make a shell/bash script of. I can write it in terms of $1 easily:
$1
foo $1 args -o $1.ext
aparse() { while [[ $# > 0 ]] ; do case "$1" in --arg1) varg1=${2} shift ;; --arg2) varg2=true ;; esac shift done } aparse "$@"