My Tech Notes
Search This Blog
sed: append string to the end of the matching line
The orginal file file.txt:
abc cde efg
Apend 123 to the line: cde. The expected result text should be:
abc cde 123 efg
The sed command:
sed '/^cde/ s/$/ 123/' file.txt
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment