I would like to insert lines into a file in bash starting from a specific line.
Each line is a string which is an element of an array
line[0]=\"foo\"
Or anoter one example with the sed:
sed
echo -e "line 1\nline 2\nline 3\nline 4" > /tmp/test.py cat /tmp/test.py line 1 line 2 line 3 line 4 sed -i '2 a line 2.5' /tmp/test.py # sed for inside of the file 'LINE_NUMBER append TEXT' cat /tmp/test.py line 1 line 2 line 2.5 line 3 line 4