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

Re: [PATCH] More stuff for Etc/FAQ



On Sun, Jan 14, 2024, at 5:37 PM, Bart Schaefer wrote:
> On Sun, Jan 14, 2024 at 12:47 PM Lawrence Velázquez <larryv@xxxxxxx> wrote:
>>
>> > +  mytt($(command)) removes trailing newlines from the output of mytt(command)
>> > +  when substituting, whereas mytt(${ command }) and its variants do not.
>>
>> Hm, this diverges from the behavior of (m)ksh and (soon) bash:
>
> This was based on the discussion (and Sebastian's sample code) of how
> mksh ${|REPLY=$'abc\n'} works.  I thought it better to be consistent
> for all of these forms.

I'm inclined to agree, despite the inconsistency with $(...) and
the other shells.  In zsh it will be easy to use something like

    foo=${${ cmd }%$'\n'}

if desired, while in the other shells preserving trailing LFs is
still annoying.


> Defintely worth mentioning in the FAQ tho.

A quick aside in the manual might also be good.


-- 
vq




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