0

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?

0

1 Answer 1

1

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'.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .