【问题标题】:grep is not working when upgrade to mountain lion升级到山狮时 grep 不起作用
【发布时间】:2012-10-08 13:57:20
【问题描述】:

最近我在使用 OSX 山狮。当我使用 Terminal.app 时,我发现我的 grep 无法再次工作。

不管我做什么,grep总是报警告:

 $ grep --version

    *usage: grep [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
        [-e pattern] [-f file] [--binary-files=value] [--color=when]
        [--context[=num]] [--directories=action] [--label] [--line-buffered]
        [--null] [pattern] [file ...]*

My grep is locate at /usr/bin/:

    $ ls -lh /usr/bin/grep

    *-rwxr-xr-x  3 root  wheel    29K Jul 26 22:52 /usr/bin/grep*

我不确定这个 grep 是否太小,只有 29K。

【问题讨论】:

  • mdfind 对我来说比 grep 有用得多!

标签: macos terminal grep osx-mountain-lion


【解决方案1】:

您是否设置了GREP_OPTIONS(设置为无效)?输入 env 将转储您的环境变量,您可以查看这些变量以找到它(我通常使用 grep,但是...)

【讨论】:

  • 哦,谢谢,我已经设置了 GREP_OPTIONS: export GREP_OPTIONS='-P --color=auto',-P 选项根本不起作用...当我删除 -P 选项时,它作品。谢谢你:)
猜你喜欢
  • 2012-12-17
  • 2012-07-26
  • 2015-08-22
  • 1970-01-01
  • 1970-01-01
  • 2012-11-09
  • 2012-07-25
  • 1970-01-01
  • 2012-12-06
相关资源
最近更新 更多