On Sun, 2 Jun 2013 03:09:31 -0400 Mike Frysinger wrote: > there's no way to undo the local thus it affects the rest of the > func. this makes sure the change is actually localized to where it > is needed. -mike In other languages you can freely introduce local scopes { ... }, this isn't possible in Bash since a local corresponds to a function; but it's not really that hard to replicate, now consider this instead: test() { local test="FUNCTION" echo ${test} x(){ local test="LOCAL SCOPE 1" echo ${test} };x echo ${test} x(){ local test="LOCAL SCOPE 2" echo ${test} };x echo ${test} } test Now 'x' is vague, you could replace 'x' by a name documenting the scope. I consider this to be more clean than using a variable to remember it, especially when multiple local scopes are to be used after each other. -- With kind regards, Tom Wijsman (TomWij) Gentoo Developer E-mail address : TomWij@gentoo.org GPG Public Key : 6D34E57D GPG Fingerprint : C165 AF18 AB4C 400B C3D2 ABF0 95B2 1FCD 6D34 E57D