bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 5.3: Why is <(cmd) allowed in func names of func defs?


From: Koichi Murase
Subject: Re: 5.3: Why is <(cmd) allowed in func names of func defs?
Date: Thu, 12 Jun 2025 01:18:29 +0900

2025年6月11日(水) 23:10 Chet Ramey <chet.ramey@case.edu>:
> On 6/3/25 4:35 PM, Robert Elz wrote:
> > A function name should remain a shell "word" - including being possibly
> > partly or fully a quoted word, after all, if it contains operator chars,
> > white space, or quoting chars, then it will need to be quoted to be
> > invoked, it seems eminently sensible to require such a thing to be
> > quoted when defined as well.
>
> That wouldn't have been backwards compatible, so I didn't add quote
> removal.

Are there actual cases where the quote removal would change the
behavior of existing scripts that worked in Bash <= 5.2? In my
understanding, in Bash <= 5.2, any function names that could be
affected by quote removal haven't been allowed, so there shouldn't be
compatibility issues caused by turning on the quote removal.

$ bash-5.2 --norc
$ a\b\c() { echo yes; }
bash-5.2: `a\b\c': not a valid identifier
$ 'abc'() { echo yes; }
bash-5.2: `'abc'': not a valid identifier
$ "abc"() { echo yes; }
bash-5.2: `"abc"': not a valid identifier

--
Koichi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]