April 2018
Beginner
284 pages
7h 3m
English
$ awk '
BEGIN{
var="I love AWK tool"
print $var }'
131522183527
Then you run the following command against this file:
$ awk '{if ($1 > 30) print $2}' myfile
How many numbers will be printed?
135 325 142215 325 152147 254 327
And you run the following command:
$ awk '{
total = 0
i = 1
while (i < 3)
{
total += $i
i++
}
mean = total / 3
print "Mean value:",mean }' myfile
What is wrong with the previous code?
$ awk -F":" '$3 < 1 ' /etc/passwd