SED – Insert text after match
General syntax:
- sed “s/search-for-regex/& replace-with/” filename.txt
- sed "s/BEGIN AS/& \n\nSET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED/" Plans_s.sql
- s/search-for-regex/replace-with/ = search and replace command
- & = the matched text (effectively leaves the matched text alone rather than “replacing” it)
- \n = carriage return