So I have a range, say 2-4. And I have three lines:firstsecondthirdI need my output to be:2 first3 second4 thirdI'm trying this on BSD (Mac) awk/sed, which seems to be making it harder.
Awk/sed: add line numbers to text from within a range
awk;sed
nl is ideally suited:nl -v2 -p -bawill start counting from 2 (-v2), ignoring page changes (-p) and numbering all lines (-ba).