back
toc
next
Example 2
Emulation of wc -w
BEGIN{ w=0 }
{ w+= NF }
END{ print w }
END{ print w }; { w+=NF }; BEGIN{ w=0 }
would work too.