Variables

Linux Scripting

Last Update Unknown

Variables

Variables are defined as follows:


To access the value stored in a variable, prefix its name with the dollar

sign ($) and wrap the variable name between curly braces {…}:


You can also make a variable read-only by using the readonly keyword. 

After a variable is marked read-only, its value cannot be changed.


Special Variables


Variable Length ${#var}