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

Re: [PATCH] More stuff for Etc/FAQ



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