1. Creating variables
Variables are case sensitive and capitalized by default. Giving local variables a lowercase name is a convention which is sometimes applied. However, you are free to use the names you want or to mix cases. Variables can also contain digits, but a name starting with a digit is not allowed.
To set a variable in the shell, use
VARNAME="value"
Putting spaces around the equal sign will cause errors. It is a good habit to quote content strings when assigning values to variables: this will reduce the chance that you make errors.
2. Exporting variables
A variable created like the ones in the example above is only available to the current shell. It is a local variable: child processes of the current shell will not be aware of this variable. In order to pass variables to a subshell, we need to export them using the export built-in command. Variables that are exported are referred to as environment variables. Setting and exporting is usually done in one step:
export VARNAME="value"
A subshell can change variables it inherited from the parent, but the changes made by the child don't affect the parent.
On this page of the site you can watch the video online Linux Bash Guide -- echo : Creating variables and Exporting variables with a duration of hours minute second in good quality, which was uploaded by the user WPJ852 06 March 2017, share the link with friends and acquaintances, this video has already been watched 231 times on youtube and it was liked by 0 viewers. Enjoy your viewing!