如何FGREP 2破折号' - '? [英] How to FGREP 2 dashes '--'?

查看:129
本文介绍了如何FGREP 2破折号' - '?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

fgrep -ircl --include = *。{sql}[ - ]* 似乎没有做到这一点。请帮助...



感谢您的答复。我正试图用'#'替换' - ',并且有一段艰难的时间。我创建了一个新问题这里。如果您可以提供帮助,那就太棒了。 如果你想fgrep所有以 .sql 然后使用

  fgrep -ircl --include = *。sql  -   - *(

或(注意 {sql,} $ b $ pre $ $ $ $ $ $ $ $ $

如果您想要fgrep多种类型的扩展名,请使用类似于



  fgrep -ircl --include = *。{sql,txt}  -   -  * 

正如其他人已经提到的那样,第一个 - 会告诉fgrep停止查找标志和选项。 c $ c> - 是固定字符串模式。


fgrep -ircl --include=*.{sql} "[--]" * doesn't seem to be doing the trick. Please help...

Thanks for the responses guys. I am trying to replace the '--' with '#' and am having a tough time. I created a new question here. If you could help, that had be awesome.

解决方案

If you want to fgrep all files that end with .sql then use

fgrep -ircl --include=*.sql -- -- *

or (note the comma in {sql,}:

fgrep -ircl --include=*.{sql,} -- -- *

If you want to fgrep more than one type of extension, then use something like

fgrep -ircl --include=*.{sql,txt} -- -- *

As others have already mentioned, the first -- tells fgrep to stop looking for flags and options. The second -- is the fixed-string pattern.

这篇关于如何FGREP 2破折号' - '?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆