LoginSignup
0
2

More than 5 years have passed since last update.

grepで、正規表現でないただの文字列を検索する

Last updated at Posted at 2017-05-26

正規表現じゃない文字列を検索したいときがある。

$-[] という文字列を検索したいとして、

perlでやると

cat hoge.txt | perl -nle 'print if $_ eq "$-[]"'

だけど、grepで

cat hoge.txt | grep -F -e '$-[]'

すれば良い。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2