In AUK he can display number of fields using a variable called an F.
Remember that fields are items which are by default separated by space.
So if we pass output of eco command one two three four into awk program
we see that in our case we have four fields which is correct because we have fields 1 2 3 and 4
if we prepared Dorsai in before and I have got printed string for.
Why.
Because don't assign is used for displaying fields.
Dead means dead and F has a value of four and dollar sign for will display for field in our case.
String for.
So if we change do not assign an F to assign for if we get completely same result.
What is really powerful here is the option to do math.
So if we want to display a field which is before the bomb we can display a number of fields minus one
which will print 3 and we can also continue in a similar way.
For example number of fields minus 2 and we see displayed string 2.
But if we say display field number of fields plus 2 or whatever else for example plus 1 which cannot
exist because we have only four fields.
The result is that we got nothing printed.
Now we just play out table and for each line print number of fields
so into awk main section will bring in an F
and we see that each line of table of table file has three fields which is correct.
We can of course make the printing more readable by printing something like number of fields in this
line.
And great.
It works perfectly.