Variables
Variables store data that scripts can reference and manipulate.
- Declaration:
var=value - Access:
$varor${var} - Types: Strings, integers, arrays
- Read-only:
readonly var - Environment export:
export var
Input:
name="Pandu"
echo "User: $name"
readonly name
Output:
User: Pandu
Explanation: name is a string variable; readonly prevents reassignment.
References: