http://blog.uouo123.com/post/704.html
文本如下, 将第一个 22 替换为 33
11 22 11 22 11 22
匹配到 第一个 22, 然后替换成 33
sed -i '0,/22/s//33/' file
0,/22/
表示从第 0 行匹配到第一个 22 行
sed -i ':a;N;$!ba;s/22/33/' file