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

Reply via email to