I\'m writing the script that searches for lines that match some pattern. I must use sed for this script. This works fine for searching and printing matched lines:
Here's the simplest way:
awk '{print ln++ ": " $0 }'