March 2002
Beginner
504 pages
10h 47m
English
So far you have learned about the basics of using awk, now you will look at some of its more powerful features:
Variables
Flow control
Loops
Variables in awk are similar to variables in the shell; they are words that hold a value. The basic syntax of defining a variable is
name=value
Here name is the name of the variable and value is the value of that variable. For example, the following awk command
fruit="peach"
creates the variable fruit and assigns it the value peach. There is no need to initialize a variable; the first time you use it, it is automatically initialized.
Like the shell, the name of a variable can contain only letters, numbers, and underscores. A variable's name cannot start with a number.
You can ...
Read now
Unlock full access