I have a sed script that does insert a text line at a certain line.
Here's my sed script:
20i
- the line number\
- inserts into a new line line number has something in it.- import NewPage from './newpage/index'; - the text line inserted into the line.
file - the file where the text is.
sed -i "20i \ import NewPage from './newpage/index'; " file
What I'm trying to achieve is: the ability to check if the keyword "NewPage" exists in the document -> than do not insert the sed line.
Any way to do this?
Thanks in advance, AT