sed insert line with spaces to a specific line

后端 未结 4 1629
暖寄归人
暖寄归人 2021-01-30 16:01

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 f

4条回答
  •  感动是毒
    2021-01-30 16:34

    You only need one \ to input multiple blanks like this

    sed -i "${line} i \    ${text}" $file
    

提交回复
热议问题