Reputation: 76785
In Bash, you can create a read-only variable
declare -r somevar='bla'
I tried to find something similar in POSIX sh
, but the only thing that comes close is this phrase in the set
documentation:
[...] read-only variables cannot be reset.
How can I create such a read-only variable?
Upvotes: 8
Views: 2113