Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] More stuff for Etc/FAQ
- X-seq: zsh-workers 52481
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] More stuff for Etc/FAQ
- Date: Sun, 14 Jan 2024 19:39:53 -0500
- Archived-at: <https://zsh.org/workers/52481>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <CAH+w=7Z=UYYy01fi=3BgphOcBgL1USZxv9Po4bxjF5-K_so8Pw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YUUkKQ=P-+C8TNoK5CgH0aYssE_EFsXR8tJG8zyqizuQ@mail.gmail.com> <5cf3cd9d-d2f7-451e-b42b-f10c0d12c625@app.fastmail.com> <CAH+w=7Z=UYYy01fi=3BgphOcBgL1USZxv9Po4bxjF5-K_so8Pw@mail.gmail.com>
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