regex

Find matching pattern and then search and replace

Tag(s):

# Find line with MATCH_PATTERN. Then, SEARCH and REPLACE.
sed -i "/MATCH_PATTERN/b; s/SEARCH/REPLACE/" tmp.txt

Explanation:

Subscribe to RSS - regex