2

agrep はagrep: pattern too long (has > 32 chars)、パターン文字列にピリオド (.) がある場合にエラーを返しますが、それ以外の場合はエラーになりません。

2つの文字列を(ほぼ)比較したいので、そのためにagrepを使用していますが、エラーが発生しますagrep: pattern too long (has > 32 chars)。しかし、パターン文字列にピリオドがなければエラーにならないことがわかりました (なぜ?)

`echo "The quick brown fox jumped over the lazy dog." | agrep -c -4 "The quick brown fox jumped over the lazy dog."`

予期される出力は 1 であり、代わりにエラーが発生します。 agrep: pattern too long (has > 32 chars)

ピリオドを削除すると機能します。

$ echo "The quick brown fox jumped over the lazy dog." | agrep -c -4 "The quick brown fox jumped over the lazy dog"  
1
4

2 に答える 2