Re: Have var+func sourced in a subroutine but they don't seem to end up in same scope

2019-07-29 Thread Ilkka Virta
On 29.7. 09:25, L A Walsh wrote: The library-include function allows me to source a library file that is in a relative path off of PATH (a feature not in bash, unfortunately). [...] I tried putting exporting the data and the function with export but it ended up the same. The variables weren'

Re: Have var+func sourced in a subroutine but they don't seem to end up in same scope

2019-07-29 Thread Greg Wooledge
On Sun, Jul 28, 2019 at 11:25:24PM -0700, L A Walsh wrote: > util_fn () { > > declare [-x] foo=1 > declare [-x] bar=${foo}2 > > real_util_fn() { > makes use of bar to get 'foo2' > } > > real_util_fn "$@" > } You do realize that despite your indentation, and despite the definition

Have var+func sourced in a subroutine but they don't seem to end up in same scope

2019-07-28 Thread L A Walsh
I have a shell script that includes a util script via a library-include function. The library-include function allows me to source a library file that is in a relative path off of PATH (a feature not in bash, unfortunately). What I just noticed was a problem where the included file has local da