f() { local x readonly x=2 } unset x f x=4 [ "$x" = 4 ]