tags:

views:

44

answers:

1

Hi, I am looking in the content of several files for strings like:

(2E)-3-({5,6-dihydroxy-3-methyl-2-oxo-4-[(1E)-prop-1-en-1-yl]-2,3-dihydro-1-benzofuran

with grep, so I try to do:

grep -n "(2E)-3-({5,6-dihydroxy-3-methyl-2-oxo-4-[(1E)-prop-1-en-1-yl]-2,3-dihydro-1-benzofuran" *.data

but I get errors, probably due to the fact that the string is complex.

Are there additional grep options or another way for me to find this string in the files?

Thanks

+2  A: 

I don't have my man pages to hand, but have you tried grep -F? I think it turns off regexp and treats the pattern as a fixed string. fgrep does the same.

Chris
+1 (checked from the manpage, `grep -F` is shorthand for `--fixed-string`)
Kimvais
great thanks that was it
asdf