I mean, if you knew you only wanted to find/replace on line 4, why not simply stop the search after the first match?
The syntax escapes me at the moment, but I'm quite sure I've used sed (or maybe awk?) in the past to do exactly that
The syntax escapes me at the moment, but I'm quite sure I've used sed (or maybe awk?) in the past to do exactly that
I used "quite some time" because this happened months ago and I don't recall the exact time on the delete. I don't think deleting a line was any faster than doing a find / replace on 1 line. If sed is reading and writing the file in both cases I'd expect both to have the same performance.