This is an old revision of the document!

The readonly builtin command

readonly [-p] [-a] [-A] [-f] [NAME[=VALUE] ...]

The readonly builtin command is used to mark variables or functions as read-only, which means unchangable, which implies it can't be unset anymore.

Option Description
-a refer to normal arrays
-A refer to associative arrays
-f refer to functions
-p print all read-only variables or functions, -a, -A and -f can be used to filter. The output is reusable as input

An argument of -- disables further option processing.

The return status is 0 unless an invalid option or an invalid combination of options is given or a NAME is invalid.

  • in POSIX┬«, only the -p option is specified
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
You could leave a comment if you were logged in.
  • commands/builtin/readonly.1294076013.txt
  • Last modified: 2011/01/03 17:33
  • by thebonsai