linux 中 sed命令删除单引号

 

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;

。 

 

posted @ 2023-11-03 16:35  小鲨鱼2018  阅读(232)  评论(0编辑  收藏  举报