bash – How to grep for case insensitive string in a file?

bash – How to grep for case insensitive string in a file?

You can use the -i flag which makes your pattern case insensitive:

grep -iF success... file1

Also, there is no need for cat. grep takes a file with the syntax grep <pattern> <file>. I also used the -F flag to search for a fixed string to avoid escaping the ellipsis.

For me SQL=echo $line | grep -iF SQL;
IT works perfect

bash – How to grep for case insensitive string in a file?

Leave a Reply

Your email address will not be published.