5
1
$ echo -e "AsometAhingA\nsomethingA\nASomethiAng"
AsometAhingA
somethingA
ASomethiAng
$ echo -e "AsometAhingA\nsomethingA\nASomethiAng" | sed "s/A//"
sometAhingA
something
SomethiAng
$
I know that sed "s/A//"
deletes the first match in every line.
But I want to delete only the first match in a text file or stream.
How can I do this?
Like: sed -i "MAGIC" file.txt
http://stackoverflow.com/questions/148451/how-to-use-sed-to-replace-only-the-first-occurrence-in-a-file – Ciro Santilli 新疆改造中心法轮功六四事件 – 2016-04-26T13:57:32.780