Hacker News new | ask | show | jobs
by yiyus 1980 days ago
There is no need to initialize variables with -v. You could just do:

    awk '/Time/{printf("%d %s ", ++j, $3)} ...
1 comments

Or use a begin block: 'BEGIN { j = 1 } /Time/ … '

I find it best to restrict the use -v to injecting environment variables into my awk scripts.