On Thu, May 28, 2026 at 14:23:53 +0200, Félix Hauri via Bug reports for the GNU 
Bourne Again SHell wrote:
> Currently, I use extdebug in order to avoid loop for this:
> 
>   revArray() { 
>     function _funcRevArray() { 
>         local -n _fRevVar=$1
>         shift
>         _fRevVar=("${BASH_ARGV[@]::$#}")
>     }
>     local -n _revVarCnt=$1
>     local _revVarName=$1
>     shift
>     shopt -s extdebug
>     _funcRevArray "$_revVarName" "${_revVarCnt[@]}"
>     shopt -u extdebug
>   }

The manual (under BASH_ARGV) says "Setting extdebug after the shell has
started to execute a script, or referencing this variable when extdebug
is not set, may result in inconsistent values."

I don't doubt that it's working for you, but that wording worries me.

Reply via email to