Date: Thu, 3 Feb 2022 16:19:08 -0500 From: Greg Wooledge <g...@wooledge.org> Message-ID: <YfxGzCsd4AgoKTM/@wooledge.org>
| This declares the variables at the wrong scope. You are correct - I never normally use "declare" for anything, so I had forgotten that it was essentially a clone of "local" (rather than "local" being "declare -l" or something similar (I know declare has a "-l" which is something entirely different, that's not the point). Since this is bash local stuff, it would be useful to add an "uplevel" option to declare, so that things like this can work. It has -g already, and while useful, it doesn't solve this problem. kre