1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 23:02:07 +02:00
tldr/pages/common/readonly.md
Lena 9ced683c99
style-guide: add guidelines for standard streams; fix remaining pages (#11196)
* readonly, {un,}compress, zbarcam: use proper syntax for IO streams

* style-guide: add guidelines for standard streams

* duckdb, perl: add backticks around stdin and stdout
2023-10-24 06:55:09 +05:30

541 B

readonly

Create or modify read-only variables within a shell script, preventing the variable from being changed by subsequent commands. This is useful when you want to ensure that a variable retains a constant value throughout the execution of a script. More information: https://manned.org/readonly.1p.

  • Create a read-only variable:

readonly {{variable_name}}={{value}}

  • Mark a variable as read-only:

readonly {{existing_variable}}

  • [p]rint the names and values of all read-only variables to stdout:

readonly -p