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

Re: [bug] () { echo $#} $'' is zero



On Mar 3,  3:16pm, Ryan Wilson wrote:
} Subject: [bug] () { echo $#} $'' is zero
}
} Subject says it all. The empty string $'' is not passed to commands the same
} way the empty strings "" and '' are:

$'...' is not a quoted expression, it's a substitution (at least as far
as zsh is concerned).  It behaves like expanding a $parameter reference,
except that the value is the string inside the '...' part.

Thus
    set -- $''
is more akin to
    x=''
    set -- $x
than to
    set -- ''

This does appear to be out of step with other shells.  Follow-ups to
zsh-workers.



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