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 bash builtin command.

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

Related:

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 Powershell command: Set-Variable -option:ReadOnly


© Copyright SS64.com 1999-2013
Some rights reserved