readonly

Mark variables/functions as readonly.
SYNTAX
      readonly [-apf] [name] ... 

OPTIONS
      -f   Each name refers to a shell function
      -a   Each name refers to an array variable
      -p   Print a list of all readonly names (This is the default)

The values of these names may not be changed by subsequent assignment.

The `-p' option causes output to be displayed in a format that may be reused as input.

The return status is zero unless an invalid option is supplied, one of the name arguments is not a valid shell variable or function name, or the `-f' option is supplied with a name that is not a shell function.

readonly is a BOURNE shell command and a POSIX `special' builtin.

"The stupid neither forgive nor forget, the naive forgive and forget, the wise forgive but do not forget" - Thomas Szasz (The second sin)

Related commands:

chmod - Change access permissions
env - Display, set, or remove environment variables
export - Set an environment variable
function - Define Function Macros
hostname - Print or set system name
local - Create variables
printenv - Print environment variables
shift - Shift positional parameters

Equivalent Windows NT commands:

SET - Display, set, or remove Windows NT environment variables
SETX - Set environment variables permanently
REG - Read, Set or Delete registry keys and values
ATTRIB
- Change file attributes



Back to the Top

Simon Sheppard
SS64.com