You probably are aware of variables in Bash shell scripting. .
Like other programming and scripting languages you use variables to store the data and then reference them later in future commands.
And it will print quotHello Linux Handbookquot.
Outside of the example above thereaposs also a surprisingly large amount of things you can do with variables such as filling in a default value when the variable isnapost set and assigning multiple values to a single variable.
Let me show you these unusual and advanced usage of variables in bash scripting.
Excluding the above example the most common type of variable youaposll find in Bash is arrays.
The above example assigns both Linux Handbook and Itaposs FOSS as the values for the name variable.
How do you go about accessing each value though.
If you run echo name youaposll see that it prints the first value Linux Handbook. To access the other values youaposll need to use a different syntax for variables.
News Link: https://linuxhandbook.com/variables-bash-script/.