Hạnh Nguyễn
Member
How do you add a line to a shell script?
Answer
sed – Inserting Lines in a File
Answer
sed – Inserting Lines in a File
- Insert line using the Line number. This will insert the line before the line at line number ‘N’. Syntax: sed ‘N i <LINE-TO-BE-ADDED>’ FILE.txt Example: …
- Insert lines using Regular expression. This will insert the line before every line where pattern match is found. Syntax: