help-bash
[Top][All Lists]
Advanced

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

Re: Is it possible to export a bash array variable?


From: Stan Marsh
Subject: Re: Is it possible to export a bash array variable?
Date: Mon, 05 Jan 2026 09:26:02 -0700

From:   Zachary Santer
Subject: Re: Is it possible to export a bash array variable?
Date:   Mon, 5 Jan 2026 10:59:12 -0500

>Haven't tested this, but how about:

>shopt -s lastpipe
>printf '%s\0' "${foo[@]@k}" |
>  gawk4 '
>    BEGIN {
>      RS = "\0"
>    }
>    {
>      getline value
>      foo[$0] = value
>    }'

Yeah, that could work as well.  I've never used @k, so I have no idea
what it does.  But it might prove useful to read up on it somewhere
down the road.

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

When responding to my posts, please try to refrain from giving bureaucratic 
answers.
If you have nothing useful to say, then just click Next and go on.



reply via email to

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