How do you add a line to a shell script?

How do you add a line to a shell script?
Answer
sed – Inserting Lines in a File
  1. 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: …
  2. Insert lines using Regular expression. This will insert the line before every line where pattern match is found. Syntax:
19 апр. 2015 г.
 

Tìm kiếm

Back
Top