about "$@"

By Hal Canary, 2004-06-01 16:43:27 (link)
#computers-code

#!/bin/sh
## test.sh ##
for x in  $*  ; do echo $x; done ; echo "" ;
for x in "$*" ; do echo $x; done ; echo "" ;
for x in  $@  ; do echo $x; done ; echo "" ;
for x in "$@" ; do echo $x; done ; echo "" ;

Output:

$ code/test.sh 1 "2 3"
1
2
3

1 2 3

1
2
3

1
2 3

(back)