4 ms·
FYI you can add line numbers (cat -n behavior) within awk directly as so: awk '{print NR, $0}'
by veyron 15y ago
FYI you can add line numbers (cat -n behavior) within awk directly as so:
awk '{print NR, $0}'
- gnosis 15y agoThe nl command (part of coreutils) is specifically written for numbering lines. It can do simple line numbering, along with various other styles and formats. Its man page can be seen here: http://linux.die.net/man/1/nl http://linux.die.net/man/1/nl
- veyron 15y agoawk's sprintf can do all of that. Not saying it's the right tool for the job, but the parent did have a pipeline already using awk.