我想在Unix中搜索Exact word pattern.示例:Log.txtfile包含以下文本:
aaa
bbb
cccaaa ---> this should not be counted in grep output looking for aaa
Run Code Online (Sandbox Code Playgroud)
我使用以下代码:
count=$?
count=$(grep -c aaa $EAT_Setup_BJ3/Log.txt)
Run Code Online (Sandbox Code Playgroud)
这里输出应该是==> 1而不是2,使用上面的代码我得到2作为输出.有些东西不见了,所以有人可以帮我这个吗?