Re: feature request: ${@ command; } and ${* command; } funsubs to expand to all elements of the local array REPLY

Koichi Murase <[email protected]> Thu, 2 Apr 2026 18:23:54 +0900
Newsgroups gmane.comp.shells.bash.bugs
Message-ID <CAFLRLk_BZANPkaWP_Jh_E76U5a88yows+LmVDBRjcGk=zyumPw@mail.gmail.com>
I'm also interested in this. We already have some functions that
return an array through REPLY in bash-completion (see e.g. Ref. [1]).

[1] https://github.com/scop/bash-completion/blob/881d12439916a80aa1d804df57676d665f4f075d/bash_completion#L248

I actually suggested the same feature in Ref. [2] with a slightly
different syntax. I chose ${@| cmd; } so that it is distinct from
${<word> cmd; } to keep it for future extension. I discussed it partly
in Ref. [3]. However, ${@ cmd; } is still a possible option.

[2] https://lists.gnu.org/archive/html/bug-bash/2025-09/msg00023.html
[3] https://lists.gnu.org/archive/html/bug-bash/2025-09/msg00051.html

--
Koichi