我想使用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