Use the readonly command of linux to mark shell variables or functions as read-only
This article mainly introduces the use of linux's readonly command to mark shell variables or functions as read-only, the article is very detailed, has a certain reference value, interested friends must read it!
The readonly command is mainly used to define one or more variables and set read-only properties, set read-only properties for one or more defined variables, display all variables that contain read-only attributes, set read-only properties for one or more functions that have been defined, and display all functions that contain read-only attributes.
Syntax format: readonly [parameters]
Common parameters:
Reference example
Show all read-only variables:
[root@linuxcool ~] # readonly
Displays all arrays with read-only attributes:
[root@linuxcool] # readonly-a
Displays all associative arrays with read-only attributes:
[root@linuxcool] # readonly-A
Displays all functions that have read-only properties:
[root@linuxcool] # readonly-f
The option after it is not valid:
[root@linuxcool ~] # readonly-these are all things that use linux's readonly command to mark shell variables or functions as read-only. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!