Sample Header Ad - 728x90

How to add text to end of line when pattern is matched?

10 votes
7 answers
21782 views
inputs: line1 with the PATTERN that contains ( ) line2 with the PATTERN that contains ( ) lineN with the PATTERN that contains ( ) outputs: line1 with the PATTERN that contains ( ) ; line2 with the PATTERN that contains ( ) ; ... lineN with the PATTERN that contains ( ) ; I tried this: find . -name "test.txt" -print | xargs sed -i "/PATTERN/ s/$)/); /g" but it didn't work.
Asked by user3342338 (335 rep)
Feb 28, 2014, 10:03 PM
Last activity: Apr 13, 2024, 01:01 PM