當我試圖找到模式「 - 文件名」,我得到了奇怪的錯誤信息這是一個GNU grep bug還是我很笨? (新手問題)
[email protected]:~$ grep -file-name README.txt
grep: ile-name: No such file or directory
[email protected]:~$ grep \-file-name README.txt
grep: ile-name: No such file or directory
[email protected]:~$ grep '-file-name' README.txt
grep: ile-name: No such file or directory
[email protected]:~$ grep '\-file-name' README.txt
-- works well
我覺得grep的解釋「-file名」作爲-f ILE名,如果我不使用'-file-name'。 我讀了關於grep和正則表達式的文檔,但是我找不到原因。 在我看來,一目瞭然,文件名也應該起作用。
這是一個GNU grep bug嗎?還是常見的linux風格? 因爲我是linux環境的新手,所以我不知道這一點。
GNU grep的版本是2.5.4
謝謝你的回答。 – lymose 2011-03-24 00:03:55