Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
175 views
in Technique[技术] by (71.8m points)

$无法对$进行转义?

adm@localhost:~$
adm@localhost:~$ 
adm@localhost:~$ 
adm@localhost:~$ pwd

上面这个文档需要删除以pwd结尾的行

:%g/pwd$/d

成功了。

需要删除以$结尾的行

:g/$$/d

为何对$转义,不起作用了?

图片描述

图片描述


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你漏了%?
测了加上就可以,你上面的代码前两行后面有个空格,你可以用:set list 查看
或者你可以用:%g/$$s*/d


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...