5 ms·
Yup, use awk for similar tasks: awk '{ print FNR "\t" $0 }' test.txt 1 one 2 two 3 three 4 5 five
by nuxi 15y ago
Yup, use awk for similar tasks:
awk '{ print FNR "\t" $0 }' test.txt
1 one
2 two
3 three
4
5 five
- sigil 15y agoYeah, I usually use awk or perl for this (depends on my mood). Just find it annoying that the unix program whose stated purpose is to number lines is basically dead to me.