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

Re: nesting issue



On Sun, May 5, 2024, at 4:14 PM, Ray Andrews wrote:
> That's good to know and grammatically  satisfying.  Almost 'necessary' 
> because the work of quotation in a command substitution is independent 
> of what comes next.

Useful and sensible, but not "necessary" by any means.  One of the
reasons the legacy `...` form is discouraged is that in some shells
it requires nested double quotes to be backslash-quoted.

	% ksh -c 'typeset -p .sh.version'
	.sh.version='Version AJM 93u+ 2012-08-01'
	% ksh -c 'echo "`echo "a   b   c"`"'
	ksh: : cannot execute [Is a directory]
	a b c
	% ksh -c 'echo "`echo \"a   b   c\"`"'
	a   b   c

You can make sense of this if you squint, but there's a reason no
one likes it.

-- 
vq




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