Git中的Bash一個分隔符之後的字符串我有這樣的文件:使用grep來找到一條線的beggining或爲Windows
blue|1|red|2
green|3|blue|4
darkblue|0|yellow|3
我想用grep找到任何東西行的開頭方含blue|
或|blue|
任何地方,但沒有任何darkblue|
或|darkblue|
或|blueberry|
我試圖用grep [^|\|]blue\|
但混帳擊給我的錯誤:
$ grep [^|\|]blue\| *.*
grep: Unmatched [ or [^
sh.exe": |]blue|: command not found
我做錯了什麼?什麼是正確的方法來做到這一點?
它的工作原理!所以-E和正常括號。謝謝。 – ericcire 2013-05-02 15:30:56