Hi,
I want to print the line number with the pattern of the line on a same line using multi-patterns in sed.
But i don't know how to do it.
For example, I have a file
abc
def
ghi
I want to print
1 abc
2 def
3 ghi
I know how to write it one line code, but i don't know how to put it in sed script
Does anyone know how to do it?
Thanks
@homeboy. That is not a single script, see post #4
---
AFAIK = writes to stdout and not to pattern space. Therefore I think it would always require two sed invocations.