I have included write(*,*)
in a large project. Now I want to grep
grep -n 'write(*,*)' response.f
and got nothing found. Why are expressions with parenthesess not suitable for classical grep?
I have included write(*,*)
in a large project. Now I want to grep
grep -n 'write(*,*)' response.f
and got nothing found. Why are expressions with parenthesess not suitable for classical grep?
The parentheses aren't the problem, but *
is a regex metacharacter. Try grep -nF
to not interpret as a regex:
grep -nF 'write(*,*)' response.f
Or, alternatively, escape:
grep -n 'write(\*,\*)' response.f
Your regex was interpreted as "zero or more (
, then zero or more ,
, then )
.