Error with sed unterminated s command in bash

前端 未结 1 963
再見小時候
再見小時候 2020-11-30 15:19

I\'m having a problem with using sed in a bash script. Here is the line:

sed -i \"s/\"$name\"/\"$input\"/g\" ~/input.script

I\'m getting th

相关标签:
1条回答
  • 2020-11-30 15:55

    You don't need nested quotes. Also, try changing the delimeter:

    sed -i "s@$name@$input@g" ~/input.script
    
    0 讨论(0)
提交回复
热议问题