Re: 5.3: Why is <(cmd) allowed in func names of func defs?
From:
Andreas Schwab
Subject:
Re: 5.3: Why is <(cmd) allowed in func names of func defs?
Date:
Wed, 11 Jun 2025 16:32:51 +0200
User-agent:
Gnus/5.13 (Gnus v5.13)
On Jun 11 2025, Chet Ramey wrote:
>> Bash 5.3
>> interprets the bare <( and >( as an introducer of process
>> substitutions, and the defined function has the source code of the
>> parsed process substitution.
>> $ bash-devel -c '<(echo hello) () { echo hello; }; declare -F'
>> declare -f <(echo hello)
>
> That's the function name. In general, a function name is a WORD that
> does not undergo any word expansions, not even quote removal.
Without quote removal, a lot of WORDs that can be command names (which
undergo quote removal) cannot be used as function names.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."