Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
commands:builtin:readonly [2011/01/03 17:26] thebonsai [Options] |
commands:builtin:readonly [2017/10/17 20:18] (current) ben_bash [Description] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== The readonly builtin ====== | + | ====== The readonly builtin command ====== |
===== Synopsis ===== | ===== Synopsis ===== | ||
Line 9: | Line 9: | ||
===== Description ===== | ===== Description ===== | ||
- | The ''readonly'' builtin command is used to mark variables or functions as read-only, which means unchangable. | + | The ''readonly'' builtin command is used to mark variables or functions as read-only, which means unchangeable. This implies that it can't be unset anymore. A ''readonly'' variable may not be redefined in child scopes. A readonly global may not be redefined as a function local variable. Simple command environment assignments may not reference readonly variables. |
==== Options ==== | ==== Options ==== | ||
Line 22: | Line 22: | ||
==== Return status ==== | ==== Return status ==== | ||
- | The return status is 0 unless an invalid option or an invalid combination of options is given or a ''NAME'' is invalid. | + | ^Status ^Reason ^ |
+ | |0 |no error | | ||
+ | |!=0 |invalid option | | ||
+ | |!=0 |invalid combination of options | | ||
+ | |!=0 |a given ''NAME'' is invalid | | ||
===== Examples ===== | ===== Examples ===== | ||
Line 28: | Line 32: | ||
===== Portability considerations ===== | ===== Portability considerations ===== | ||
- | ===== See also ===== | + | * in POSIX(r), only the ''-p'' option is specified |
+ | ===== See also ===== | ||
+ | * [[commands:builtin:declare]] | ||
+ | * [[commands:builtin:unset]] |