Session and utilities

The readonly command

Marks a variable as read-only: it cannot be changed or deleted during the session.

Syntax

readonly NOMBRE=valor

Most useful options

-pLists the read-only variables

Copy-ready examples

$ readonly FIJO=7 && readonlyDefine and list

You 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.

Related commands

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