Linux Today: Linux News On Internet Time.

Using Variables With awk

Nov 17, 2010, 19:35 (0 Talkback[s])

[ Thanks to Andrew Weber for this link. ]

"Variables awk supports user defined variables as well as variables that are predefined. These variables do not need to be declared like they do in bash scripts. There are three types of variables:

1. System Variables
2. Scalers
3. Arrays

System or Built-in Variables
System variables are upper case and case sensitive.

NR: number of input lines
The NR variable stores each record, when it is read it is incremented by 1 as you see in the example."

Complete Story

Related Stories: