Variables in Linux

Programmer can give a unique name to memory location or address that stores data called memory variable or variable. It is a named storage location that may take different values, but only one at a time.

There are two types of variable:

  1. System variable :- created and maintained by Linux itself. This types of variable defined in CAPITAL LETTERS. System variable , to view the system variable :command used is: $ set.
  2. User defined variable (UDV) :- Created and maintained by user. This type of variable defined in lower LETTERS. To define User defined variable syntax used is:

variable-name = value

Here “value” is assigned to given “variable-name” and value must be on right side = sign. For example:
$no=10 # This is OK,
$ 10=no # Error,
NOT OK, value must be on right side of = sign.
To define variable called “vech” having value Bus.

Leave a Reply