Local Variables − A local variable is a variable that is present within the current instance of the shell. It is not available to programs that are started by the shell. They are set at the command prompt.
Environment Variables − An environment variable is available to any child process of the shell. Some programs need environment variables in order to function correctly. Usually, a shell script defines only those environment variables that are needed by the programs that it runs.
Shell Variables − A shell variable is a special variable that is set by the shell and is required by the shell in order to function correctly. Some of these variables are environment variables whereas others are local variables.
Use of Backtick symbol (`) in shell variables:
The backtick allows you to assign the output of a shell command to a variable. While this doesn’t seem like much, it is a major building block in script programming.You must surround the entire command line command with backtick characters: