Wie append etwas am Ende einer bestimmten Zeile des Textes

Möchte ich anfügen, etwas am Ende einer bestimmten Zeile(haben einen bestimmten Charakter).
Zum Beispiel, der text ist:

Line1:  I just want to make clear of the problem
Line2:  Thanks to all who look into my problem
Line3:  How to solve the problem?
Line4:  Thanks to all.

Dann möchte ich hinzufügen, "Bitte hilf mir" am Ende

Line2:  Thanks to all who look into my problem

Sowie "Line2" ist das Stichwort. (ich muss anfügen, etwas mit grep diese Zeile durch key-word).

Also dem text nach sollte das script sein:

Line1:  I just want to make clear of the problem
Line2:  Thanks to all who look into my problem Please help me
Line3:  How to solve the problem?
Line4:  Thanks to all.

Ich weiß sed Anhängen können, etwas zu bestimmten Linie, sondern, wenn ich sed '/Line2/a\Please help me', wird es fügen Sie eine neue Zeile nach der Zeile. Das ist nicht das, was ich will. Ich will es anfügen an die aktuelle Zeile.

Könnte jemand mir dabei helfen?

Vielen Dank!

InformationsquelleAutor zhaojing | 2010-08-24

Schreibe einen Kommentar