I'm writing a wrapper script (in bash) that wraps another (bash) script. When calling the wrapped script, I need to pass all the received arguments/options to it. Is there a built in variable that holds all the options? I wrote a little while loop (see below) which works. But I wanted to know if there was an easier way.
Thanks.
What I have now:
#!/bin/bash
#Code that sets some environment variables
ARGS=""
while [ "$1" != "" ]; do
ARGS="${ARGS} $1"
shift
done
. $(dirname ${0})/startup.sh ${ARGS}
---------- Post updated at 02:36 PM ---------- Previous update was at 01:45 PM ----------
I found that I can use $@ (I just had trouble finding a good Google search query)
Thanks.
For other people's future reference, see: Reference Cards