readonly VAR=value

Category: Shell & Bash

readonly VAR=value

Create a read-only variable that cannot be changed

Creates a variable that cannot be modified. Similar to declare -r.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.