On 10/16/20 11:23 AM, [email protected] wrote:
> Bash Version: 5.0
> Patch Level: 18
> Release Status: release
>
> Description:
> This worked just fine on Bash 4.2:
>
> foo() {
> local -a args=("${!1}")
> echo "[IN] ${args[@]}"
> }
>
> declare -a args=("$@")
> echo "Bash ${BASH_VERSION}"
> echo "[OUT] ${args[@]}"
> foo args[@]
>
> eg.
> $ ./test.sh 1 2 3
Thanks for the report. There aren't any nameref variables there; this is
an order-of-evaluation problem resulting from the local array variable
declaration with the same name as the variable used in the word
expansion -- it doesn't depend on the indirect variable expansion. It was
fixed back in April, before bash-5.1-alpha was released.
--
``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/