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

Re: bug in zsh-2.6-beta21



Vincent Lefevre wrote:
> [...] But under zsh 2.6-beta21:
> 
> $ var=`echo "ab\ncd\nef"`
> $ echo $var
> ab
> cd
> ef
> $ var=`echo "ab\ncd\nef\n"`
> $ echo $var
> ab
> cd
> ef
> $
> 
> The last "\n" is not printed.

All other shells strip trailing newlines from command substitution and
POSIX requires this behaviour.  So far zsh stripped only one trailing
newline now it strips all.  But if the opposition of this change is big
enough I may change it back.  I thought that this change will be mostly
unnoticeable and I hope that it won't break any scripts.

Zoltan




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