Defining variable in shell scripting.
For processing data, it must be store in RAM memory. Generally RAM memory is divided into small locations, and each location had unique number called memory address, which is used to hold our data. scripting can give a unique name to this address of ram called memory variable or variable. You can call this as storage location which can have different value but only one at the time.
There are two types of variables:
[A} Variable defined by Linux are known as system variable. All theses variable are defined in capital letters.
[B] Variables defined by user are known as user defined variables. You can define them in capital letters as well as in small letter or can be define using capital or small letter. But it is recommended that small letters should be used while defining user defined variables.
Determine system defined variable (also know as environment variables) by command env it will show you all variable created by Linux with value assigned to the same.
[root@server ~]#env
Exercise: User defined variables.
When variable name is followed by =value, the value of the variable is set to value.
Let’s define variable angelo with value scripting
[root@server ~]#angelo=scripting
[root@server ~]#echo $angelo
scripting













