March 2018
Beginner to intermediate
416 pages
9h 24m
English
An assignment is an expression that stores a value in a variable. The simplest assignment operator is =, the equals sign. It stores the value of the right-hand-side operand as such. The assignment statement syntax is as follows:
<variable> or <field> or <array> = <constant> or <expression> or
The basic variable assignment is represented by the equals sign, =. Whatever value was assigned earlier is forgotten and the new value is assigned. For example, we assign a value to variable x=10 as follows:
$ awk 'BEGIN{ x=10; print "Number x is : ", x}'
The output on execution of the preceding code is as follows:
Number x is : 10
Assignment can store string values as well. For example, now we declare a variable message and store ...
Read now
Unlock full access