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

expansion bug in 4.0.3?



This example is easily reconstructed on Linux:

    % echo $$
    146
    % print -l ${$(</proc/$$/environ)}
    DISPLAY=:0.0 HOME=/home/duvall LOGNAME=duvall USER=duvall [ ... ]
    % print -l ${$(</proc/146/environ)}
    DISPLAY=:0.0
    HOME=/home/duvall
    LOGNAME=duvall
    USER=duvall
    [ ... ]

The only difference is that in one case the filename is specified with a
parameter, in the other, without.  If, in the former case, I explicitly
split on spaces:

    % print -l ${(s: :)$(</proc/$$/environ)}

then I get the output I want.  Alternatively, if I skip the outer
braces:

    % print -l $(</proc/$$/environ)

then the output also comes out on multiple lines.

(For those not on Linux, this file contains fields separated by null
characters.)

Is this a bug, or is there some behavior I'm not understanding properly?

Thanks,
Danek



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