我想使用grep -o
,但在git bash中没有-o
选项。有没有办法在git bash中完全工作grep
,就像它在linux bash shell中一样?如何在windows上完全工作grep git bash(msysgit)?
4
A
回答
1
没有为grep的 http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html
没有-o标志可以使用sed代替
+0
[GNU grep](http://www.gnu.org/software/grep/manual/grep.html#General-Output-Control)有一个,但它是一个GNU扩展。 – 2016-01-08 07:07:25
0
有针对在Github上的悬而未决的问题(即使它是“NVM”下)。用户UltCombo发布了workaround。引用:
打开
<Git install directory>/bin
并用一个更新的版本覆盖grep.exe
。我发现了两个备选方案提供-o
支持:尽管ezwinports的grep端口更加新颖,但我不能说这些端口是否会导致稳定性/兼容性问题。我还没有发现任何问题,但使用它需要您自担风险。
标记此社区Wiki是因为它确实是别人的工作。
另外,得到相当真棒MSYS2并享受充分的grep和co。
相关问题
- 1. 如何使用github令牌或ssh密钥设置Git Bash(msysgit)
- 2. 在Git bash中设置全局工作目录别名(Windows)
- 3. bash命令“grep -v”:0“”如何工作
- 4. 在Windows上的Git/ssh问题(git bash)
- 5. 如何在Windows上的Git Bash中退出'git diff'的结果?
- 6. 在Windows上启用自动完成git bash?
- 7. 如何在Windows上的Git Bash上使用“man”或“nano”?
- 8. bash选项卡完成如何工作?
- 9. 如何让Mitmproxy Docker在Windows Bash上工作?
- 10. Git命令如“git clone”在Git Bash中不工作
- 11. X会议在Windows上Git Bash?
- 12. 在Windows上使用Git Bash与Maven jvm.config
- 13. 如何在安装git bash后在Windows上安装vimdiff?
- 14. 为什么在我的Windows PC上“git grep”表现不稳定?
- 15. 在Windows上使用Git-GUI和Git-Bash:* .git文件的位置?
- 16. pip在Windows bash上安装烧瓶bash不能正常工作
- 17. 如何在Windows 7上完全卸载git和Railsinstaller以重新安装
- 18. 在Windows上的Git Bash - 在哪里存储和如何调用Bash脚本
- 19. 如何在Windows上的Git Bash中使用Pik for Ruby?
- 20. 我可以通过Git Bash获得在Windows上工作的位置吗?
- 21. 在Windows上的Emacs中,如何让Emacs完全忽略Windows键?
- 22. git:如何在子目录上工作
- 23. Git bash在Windows 7上。mysqldump命令不起作用
- 24. 哈德森Git插件不能在Windows上工作
- 25. 如何在Bash中工作?
- 26. 在VSO中使用外部Git Repo未完全工作
- 27. 如何在ubuntu上安装git bash?
- 28. Windows上的Git bash - 不支持sftp
- 29. Windows上的Maven,Git Bash就够了吗?
- 30. 什么是Windows上的GIT bash?
不幸的是'-P'也不存在。 – 2014-11-02 18:33:57
似乎我必须同时使用Cygwin和git bash。但Cygwin有时非常慢;( – siulkilulki 2014-11-03 20:12:43