sed replace exact match

后端 未结 3 627
暗喜
暗喜 2021-02-03 10:34

I want to change some names in a file using sed. This is how the file looks like:

#! /bin/bash

SAMPLE=\"sample_name\"
FULLSAMPLE=\"full_sample_name\"

...
         


        
3条回答
  •  既然无缘
    2021-02-03 10:53

    I believe \< and \> work with gnu sed, you just need to quote the sed command:

    sed -i.bak 's/\/sample_01/g' file
    

提交回复
热议问题