加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

正则表达式中的$ 遇到makefile

发布时间:2020-12-14 04:29:10 所属栏目:百科 来源:网络整理
导读:今天再写一个makefile 时 clean-temp: rm ` ls -a |grep ~$` 想要完成删除所有以~ 结尾的临时文件 但是这样写不能完成,只能在terminal当中完成 会提示这样的错误: /bin/sh: -c: line 0: unexpected EOF while looking for matching ``' /bin/sh: -c: line

今天再写一个makefile 时

clean-temp:
rm ` ls -a |grep ~$`

想要完成删除所有以~ 结尾的临时文件

但是这样写不能完成,只能在terminal当中完成

会提示这样的错误:

/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 1: syntax error: unexpected end of file
Makefile:2: recipe for target 'clean-temp' failed
make: *** [clean-temp] Error 1


原因:

makefile 指挥把 $$替换成$.

所以改成:

clean-temp: rm ` ls -a |grep ~$$`就ok了!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读