A lot answers here recommends $@ or $* with and without quotes, however none seems to explain what these really do and why you should that way. So let me steal this excellent summary from this answer:
| Syntax |
Effective result |
$* |
$1 $2 $3 ... ${N} |
$@ |
$1 $2 $3 ... ${N} |
"$*" |
"$1c$2c$3c...c${N}" |
"$@" |
"$1" "$2" "$3" ... "${N}" |
Notice that quotes makes all the difference and without them both have identical behavior.
Where c is the first character of the value of the IFS variable. If IFS is unset, the parameters are separated by spaces. If IFS is null, the parameters are joined without intervening separators.
For my purpose, I needed to pass parameters from one script to another as-is and for that the best option is:
# file: parent.sh
# we have some params passed to parent.sh
# which we will like to pass on to child.sh as-is
./child.sh $*
Notice no quotes, and $@ should work equally well in above situation.