sed insert line with spaces to a specific line
I have a line with spaces in the start for example " Hello world". I want
to insert this line to a specific line in a file. for example insert "
hello world" to the next file
hello
world
result:
hello
hello world
world
I am using this sed script:
sed -i "${line} i ${text}" $file
the problem is that i am getting my new line with out the spaces:
hello
hello world
world
No comments:
Post a Comment