Variables in Bash
The bash variables are the same as in other programming languages. You don’t need to specify the type of variable in bash scripting. Read the below example.
Global vs Local Variables
Global variables are accessible anywhere in the script. Where Local variables are accessible in scope only. For example, a variable is used inside a function only.
System Variables
System variables are responsible to define the aspects of the shell. These variables are maintained by bash itself. But we can modify these variables to change shell aspects.
Type env on bash shell to print all the available variables with their value.
Generally, these variables are defined in capital letters. For example PATH, SHELL, HOME, LANG, PWD and many more.
0 Comments
CAN FEEDBACK
Emoji