我已经尝试在OSX上安装GNU grep,它似乎已安装,但我无法使用它..我已经使用自制程序,Macports目前有一些问题,所以我不能使用它.
安装: brew tap homebrew/dupes; brew install grep
哪个回报: Warning: homebrew/dupes already tapped! Warning: homebrew/dupes/grep-2.21 already installed
符号链接似乎适用于/ usr/local/bin/ggrep.当我添加别名alias grep="ggrep"并做grep --version,我得到-bash: ggrep: command not found.这是真的,因为文件夹中没有ggrep.我试过安装有没有--with-default-names.
该文件夹/usr/local/Cellar/grep/2.21/bin/包含以下内容:
-r-xr-xr-x 1 Wes admin 158 Oct 14 09:27 egrep
-r-xr-xr-x 1 Wes admin 158 Oct 14 09:27 fgrep
Run Code Online (Sandbox Code Playgroud)
这对我来说很奇怪,因为文档暗示了这一点 The command has been installed with the prefix "g".
我已经看过以下帖子,但没有一个解决方案适合我.更新grep for Mac OS 10.7
有没有人有任何解决方案?我真的想用GNU grep.
产量brew unlink grep && brew link …