Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Positional Parameter "$@"



Dear ZSH maintainers,

    $ echo $ZSH_VERSION
    2.6-beta8
    $ uname -a
    SunOS chacha 5.3 Generic_101318-70 sun4m sparc

(1) $ cat foo
    #!/bin/zsh
    echo ${1+"$@"}

    $ ./foo a b c
    ./foo: ambiguous: a [2]

(2) $ cat bar
    #!/bin/ksh
    echo ${1+"$@"}

    $ ./bar a b c
    a b c

    (Same even if ksh is bash)

     Why the result is different? By the way, the following is OK.

(3) $ cat baz
    #!/bin/zsh
    echo ${1+"$*"}

    $ ./baz a b c
    a b c

     I read zshparam manual page, specially "Positional Parameters"
section. But I couldn't also explain the difference between (1) and (3). 
Will anybody point out my stupidity?

                                                           Sincerely,
--
Yoshinari KANAYA <kanaya@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Miyazaki Laboratory, Graduate School of Information Sciences,
Tohoku University, Sendai 980-77, Japan



Messages sorted by: Reverse Date, Date, Thread, Author