I'm having trouble finding documentation, but what is the command to make a user defined variable in the c shell read-only in unix?
1 Answer
You can use set -r
:
% set -r trousers = "on fire"
% echo $trousers
on fire
% set trousers = waterrrrr
set: $trousers is read-only.
% echo $trousers
on fire
This is documented in the tcsh
manpage, tcsh(1)
, and should work for both csh
& tcsh
(but I think all csh
's floating around are tcsh
these days).
Here is the online version of the manpage; I can't link directly to the applicable section, search for 'set -r'.