Sed regex change of file

前端 未结 1 823
走了就别回头了
走了就别回头了 2021-01-22 17:47

I am (unsuccessfully) trying to substitute the database host entry in a Magento local.xml file (the connection string file).

The line is the following:

&         


        
1条回答
  •  闹比i
    闹比i (楼主)
    2021-01-22 18:14

    With GNU sed:

    sed 's|\(\)|\1lala\2|' file
    

    or

    sed -E 's|()|\1lala\2|' file
    

    Output:

    
    

    0 讨论(0)
提交回复
热议问题