In Bash—Pass Arguments From Function To Another

When I’m good about using and re-using functions in Bash I always end up passing arguments through from one function to another. For example:

function pie {
  open /Applications/Emacs.app --args --debug-init "$@"
}

function pienthm {
  EMACSNOTHEME=t pie --reverse-video "$@"
}

Horrible to admit but I keep forgetting the syntax even are taking copious notes on the GNU Bash manual.

BTW: hear, hear to including Bash-isms in every shell script!

Leave a Reply

Your email address will not be published. Required fields are marked *