HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

readonly — Set read-only shell variables. More information: <https://www.gnu.org/software/bash/manual/bash.html

Submitted by: @import:tldr-pages··
0
Viewed 0 times
shellcommandreadclionlyvariablessetreadonly

Problem

How to use the readonly command: Set read-only shell variables. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-readonly>.

Solution

readonly — Set read-only shell variables. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-readonly>.

Set 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

Code Snippets

Set 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

Context

tldr-pages: common/readonly

Revisions (0)

No revisions yet.