In Bash, you can create a read-only variable
declare -r somevar='bla'
I tried to find something similar on POSIX sh, but the only thing that comes close is the phrase in the setdocumentation
[...] read-only variables cannot be reset.
How to create such a read-only variable?
source
share