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

Re: Useful zsh/datetime things



On 2003-10-10 at 04:40 +0000, Bart Schaefer wrote:
> Because an unquoted empty string always disappears.  It just happens that
> the easiest way to get an unquoted empty string is to expand an unset or
> empty-valued parameter (the former assuming setopt no_unset).
> 
> "Not split" (in the sh_word_split sense) is not equivalent to "quoted".

Ah.  Good thing that long habit keeps me using "$@" instead of dropping
the quotes to get $@ for zsh then.

Any other side-effects to not quoting variables in zsh?  Backslash
degree-of-toothpickiness, I suppose.

> You'd get strange effects if it didn't work this way; e.g., $* would
> always substitute an empty string, even when $# == 0.

And you could of course get an empty string by explicitly using "$*" or
"${*:-}" which would be the same, but make the intention explicit.  Ta.
-- 
2001: Blogging invented. Promises to change the way people bore strangers with
banal anecdotes about their pets. <http://www.thelemon.net/issues/timeline.php>



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