Use the sed command to insert a command in a line as follows:
sed -i '5i hello world ’ mytest.sh
Explanation:
sed -i insert command
5i is the fifth line
hello world is the inserted content
mytest.sh is the name of the text to be inserted.
Use the sed command to insert a command in a line as follows:
sed -i '5i hello world ’ mytest.sh
Explanation:
sed -i insert command
5i is the fifth line
hello world is the inserted content
mytest.sh is the name of the text to be inserted.