Session and utilities
The readonly command
Marks a variable as read-only: it cannot be changed or deleted during the session.
Syntax
readonly NOMBRE=valorMost useful options
-pLists the read-only variablesCopy-ready examples
$ readonly FIJO=7 && readonlyDefine and listYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- It cannot be undone in the same session: you must open a new terminal.
FAQ
What is it for?
To protect configuration constants in long scripts.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course