Possible Duplicate:
What the difference between “$@” and “$*” in bash?
For years and on dozens of occasions, I have hesitated between the use of $*
and $@
in shell scripts. Having read the applicable section of Bash's manpage over and over again, having tried both $*
and $@
, I more or less completely fail to understand the practical difference of application between the two variables. Can you enlighten me, please?
I have been using $*
recently, but don't ask me why. I don't know why, because I don't know why $@
even exists, except as an almost exact synonym for $*
.
Is there any practical difference?
(I personally tend to use Bash, but remain agnostic regarding the choice of shell. My question is not specific to Bash as far as I know.)