Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
commands:builtin:readonly [2011/01/03 17:07]
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 19: Line 19:
 |''​-p'' ​ |print all read-only variables or functions, ''​-a'',​ ''​-A''​ and ''​-f''​ can be used to filter. The output is reusable as input | |''​-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.
 ==== Return status ==== ==== Return status ====
  
-The return status is unless an invalid option ​or an invalid combination of options ​is given or a ''​NAME''​ is invalid.+^Status ​ ^Reason ​ ^ 
 +|   |no error  | 
 +|!=0  |invalid option ​ | 
 +|!=0  |invalid combination of options ​ | 
 +|!=0  |given ''​NAME''​ is invalid ​ |
  
 ===== Examples ===== ===== Examples =====
Line 27: 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]]
  • commands/builtin/readonly.1294074447.txt
  • Last modified: 2011/01/03 17:07
  • by thebonsai