ファイル内で正確な単語を見つけようとしています。単語は myServer で、検索しようとしているファイルの内容は次のとおりです。
This is myServer and it is cool
This is myServer-test and it is cool
これを行うためのさまざまな試みの結果は次のとおりです。
grep '^myServer$' test-file.txt
grep -Fx myServer test-file.txt
--> no results
grep -w myServer test-file.txt
grep -w myServer test-file.txt
grep '\<myServer\>' test-file.txt
grep '\bmyServer\b' test-file.txt
-->
This is myServer and it is cool
This is myServer-test and it is cool
ここにスイッチがありませんか?
どうもありがとう。