Re: feature request: ${@ command; } and ${* command; } funsubs to expand to all elements of the local array REPLY
Chet Ramey <[email protected]> Mon, 6 Apr 2026 10:56:50 -0400
| Newsgroups | gmane.comp.shells.bash.bugs |
|---|---|
| Organization | ITS, Case Western Reserve University |
| Message-ID | <[email protected]> |
On 4/2/26 1:54 AM, Zachary Santer wrote:
> $ printf '%s\n' "${| REPLY=( zero one two ); }"
> zero
> $ printf '%s\n' "${@ REPLY=( zero one two ); }"
> zero
> one
> two
> $ printf '%s\n' "${* REPLY=( zero one two ); }"
> zero one two
>
> Like the ${| command; } form, REPLY within the funsub starts life as
> an initially-unset local variable, not an initially empty indexed
> array variable. That way, REPLY can become either an indexed or
> associative array within the funsub.
Thanks for the proposal. I'll look at it for a future version.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
(application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCadPJsgUDAAAAAAAKCRC7WGnwZOp0q5AD AJ9aiq187J7+TNUQ1pIwZpGcJHkqOACfVdvHYfGAzkNtSREvfLqGrmovLmU= =lGFq -----END PGP SIGNATURE-----