Re: [PATCH] Define $as_echo and $as_echo_n for backward compatibility.

Zack Weinberg <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Message-ID <CAKCAbMj-r0Smnr35vtET9CRN7yMRRhBavAejG6hzFZTVgtZ4+w@mail.gmail.com>
On Fri, Mar 13, 2020 at 3:13 PM Eric Blake <[email protected]> wrote:
>
> Unpatched bash 5.0 has a bug where calling $as_echo that contains \ can
> result in unintended globbing, where the behavior of the expansion is
> dependent on the contents of the current directory.  Nasty!

Yikes!  And not just unpatched 5.0.0, either...

$ bash --version
GNU bash, version 5.0.16(1)-release (x86_64-pc-linux-gnu)
$ touch %sn; bash -c 'cmd='\''printf %s\n'\''; $cmd test'
testn$

I don't see any practical workaround and I surely hope this gets fixed
*properly* soon in bash (that discussion you linked to doesn't seem
terribly promising, though).

> But I don't
> see a problem in providing the variable definition for back-compat
> reasons (that is, bash's bug doesn't affect this patch)

Makes sense.  Pushed.  Thanks for reviewing.

zw
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.