linux 中 sed命令删除单引号

发布时间 2023-11-03 16:46:08作者: 小鲨鱼2018

 

001、

(base) [root@pc1 test02]# ls
a.txt
(base) [root@pc1 test02]# cat a.txt                ## 测试文件
use File::Basename;
use File::Spec;
use List::Util 'none';
use "Carp" kk;
(base) [root@pc1 test02]# sed 's/\'//g' a.txt      ## 错误做法
> ^C
(base) [root@pc1 test02]# sed $'s/'//g' a.txt      ## 错误做法
> ^C
(base) [root@pc1 test02]# sed $'s/\'//g' a.txt     ## 正确做法
use File::Basename;
use File::Spec;
use List::Util none;
use "Carp" kk;

。