sed 转义字符

用' '

root@ubuntu:/home/ubuntu# sed -i s,mabi=lp64d,mabi=lp64d \$\(CFLAGS\),g  `grep mabi=lp64d -rl * `
sed: -e expression #1, char 23: unterminated `s' command
root@ubuntu:/home/ubuntu# sed -i s,mabi=lp64d,mabi=lp64d '$(CFLAGS)',g  `grep mabi=lp64d -rl * `
sed: -e expression #1, char 23: unterminated `s' command
root@ubuntu:/home/ubuntu# sed -i s,mabi=lp64d,mabi=lp64d\ '$(CFLAGS)',g  `grep mabi=lp64d -rl * `
root@ubuntu:/home/ubuntu#   

 

上一篇:Linux三剑客——sed


下一篇:Blog.040 Shell 编程 sed 工具