Actually, you'll usually want to use "$@
It expands to the entire list of arguments, and when quoted each argument is treated as a separate element
. This is the behavior you'll usually want when running loops and passing the arguments to other commands.
", on the other hand, expands to the entire list of arguments as a single text string
. You'll only want to use this in certain printing and testing situations.
Note that the quotes are important for protecting the contents against shell word-splitting in either case, so never forget to quote.
" and "*
" values work the same way when used as array
indexes as well.