Robert Stoll <robert.stoll@tegonal.com> writes:
> test1 # works as exit happens outside of test1
> test2 # fails with ./src/test.sh: line 6: local: readonlyVar: readonly
> variable
Beware that you haven't specified what you mean by "works" and "fails".
I assume from the context that "fails" means "produces an error
message", but it's much hard to guess what "works" means. In general,
when reporting a problem, always explicitly answer "What do I expect to
happen?" and "What happens?".
Dale