On Mon, Jun 3, 2019 at 9:26 PM Chet Ramey <chet.ra...@case.edu> wrote: > It's not disallowed. Since a function definition is a compound command, > and all functions are global, I don't see why it shouldn't.
What I worry about is the way an executable part of the function can be freed while the function is being redefined or unset that it may cause faults because the code is still being executed. Bash doesn't document its strategy for freeing up function code so whether it's safe or not is currently ambiguous. Perhaps having one last line of code to execute after a function is redefined is currently safe, but it would be nice if it gets affirmed that it's intended to be. -- konsolebox