From http://tldp.org/LDP/abs/html/refcards.html:
"$*" All the positional parameters (as a single word) *
"$@" All the positional parameters (as separate strings)
This code shows it: given a string with items separated by spaces, $@ considers every word as a new item, while $* considers them all together the same parameter.
echo "Params for: \$@"
for item in "${@}"
do
echo $item --
done
echo "Params for : \$*"
for item in "${*}"
do
echo $item --
done
Test:
$ ./a par1 par2 par3
Your command line contains 3 arguments
Params for: $@
par1 --
par2 --
par3 --
Params for : $*
par1 par2 par3 --