Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] More stuff for Etc/FAQ
- X-seq: zsh-workers 52479
- 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 15:46:11 -0500
- Archived-at: <https://zsh.org/workers/52479>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <CAH+w=7YUUkKQ=P-+C8TNoK5CgH0aYssE_EFsXR8tJG8zyqizuQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YUUkKQ=P-+C8TNoK5CgH0aYssE_EFsXR8tJG8zyqizuQ@mail.gmail.com>
On Sat, Jan 13, 2024, at 3:48 PM, Bart Schaefer wrote:
> The file-slurping thread on zsh-users brought me here.
>
> Anything else worth mentioning?
>
> [...]
>
> + 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:
% cat ./nofork_test; echo
echo "$KSH_VERSION$BASH_VERSION$ZSH_PATCHLEVEL"
foo=${ echo abc; }
typeset -p foo
% ksh ./nofork_test; echo
Version AJM 93u+ 2012-08-01
foo=abc
% mksh ./nofork_test; echo
@(#)MIRBSD KSH R59 2020/10/31
typeset foo=abc
% Reference/bash/bash ./nofork_test; echo
5.3.0(2)-devel
declare -- foo="abc"
% zsh/zsh/Src/zsh ./nofork_test
zsh-5.9-342-gdde1259
typeset foo=$'abc\n'
If this is intentional, then it might be worth mentioning in the
FAQ, to warn users who are used to the other behavior.
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author