Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
GREPTEXT.TXT ファイルに次の文字列があります。
APLLE ME APPLE ASA\LE Ale\A\L
上記の文字列で A\L パターン マッチを検索したい。\ as をエスケープしようとしました
grep -E A\\L GREPTEST.TXT
しかし、grep は結果を返しません。
どのように合わせたらよいですか?
シェルはバックスラッシュも解釈します。引数を引用符で囲むだけです。
$ echo 'APLLE ME APPLE ASA\LE Ale\A\L' > GREPTEST.TXT $ grep -E 'A\\L' GREPTEST.TXT APLLE ME APPLE ASA\LE Ale\A\L