3 ms·
There is no need to initialize variables with -v. You could just do: awk '/Time/{printf("%d %s ", ++j, $3)} ...
by yiyus 6y ago
There is no need to initialize variables with -v. You could just do:
awk '/Time/{printf("%d %s ", ++j, $3)} ...
- tragomaskhalos 6y agoOr 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.