Variable Assignment Help

Assignment Help: >> Shell Programming - Variable

What is a Variable?

Variable is nothing but a memory storage that is used to store the value. Variable helps to refer the value in during processing.

Syntax

variable-name=value

Only digits, letters, underscore and $ should be used in variable names

Note: No blanks are permitted before and after the = sign

Shell variables are also string variables

# name="radiant"

# a=10

In the above example "radiant" and the value 10 will be treated as strings. It is impossible to perform arithmetic operations on the variable a.

The value stored in the variable name can be viewed given through using echo $variablename. This command is used to print the value on the screen.

Example

# name=radiant

# a=10

# echo $name radiant

# echo $a

10

To perform the arithmetic operations, this command has to be used as shown below

# echo $a + 10

In the given example will produce the output as 10 + 10

The user can store a null string that consists of no characters in a variable in the subsequent formats

#          name=''

#          name=

#          name=""

These formats associate the variable name to the null string.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd