sed with special characters

前端 未结 3 2010
野性不改
野性不改 2020-12-20 17:00

I have this line that I want to use sed on:

--> ASD = $start ( *.cpp ) <--

where $start is not a varaiable, I want to use sed on it a

3条回答
  •  我在风中等你
    2020-12-20 17:46

    The chacters $,*,. are special for regular expressions, so they need to be escaped to be taken literally.

    sed 's/ASD = \$start ( \*\.cpp )/ASD = \$dsadad ( .cpp )/' somefile
    

提交回复
热议问题