Classification of Variables
Learn the variable types in Bash.
We'll cover the following...
Attributes for classifying variables
The Bash interpreter has two operation modes: interactive (shell) and non-interactive (scripting). Variables solve similar tasks in each mode. However, the contexts of these tasks are different. Therefore, there are more features to classify variables in Bash than in other languages.
Let’s simplify the terminology for convenience. It’s not entirely correct, but it helps avoid confusion. When we talk about scripts, we use the “variable” term. When we talk about shell and command-line arguments, we use the “parameter” term. These terms are often used synonymously.
Attributes for classifying variables
There are four attributes for classifying variables in Bash. The following table explains them.
Classification Attribute | Variable Types |
---|