On , I learnt ...
readonly Bash variables
$myvar can’t have its value changed within the global scope.
$ myvar=2 -bash: myvar: readonly variable
You can use
declare -r to enforce immutability within a local scope (e.g.
within a function body).
the Linux Shell Scripting Tutorial wiki
for basic examples. See
this Stack Overflow answer for more
details on the differences between