| Author |
A quesiton about grep....
|
|
| SpreadTooThin 2007-03-29, 1:24 pm |
| I'm grepping through my C++ code for a delete that uses []
How (in tcsh on MAC OS X) do I grep for that?
grep [] *.cpp *.h
doesn't work...
grep "[]" *.cpp *.h
doesn't work either....
TIA
| |
| Martin Vuille 2007-03-29, 1:24 pm |
| "SpreadTooThin" <bjobrien62@gmail.com> wrote in
news:1175188233.193316.265200@n76g2000hsh.googlegroups.com:
> I'm grepping through my C++ code for a delete that uses []
>
> How (in tcsh on MAC OS X) do I grep for that?
>
> grep [] *.cpp *.h
>
> doesn't work...
>
> grep "[]" *.cpp *.h
Square brackets have special meaning in regular expressions.
Try
grep "\[\]" *.cpp *.h
MV
--
I do not want replies; please follow-up to the group.
| |
| Stephane CHAZELAS 2007-03-30, 7:17 am |
| 2007-03-29, 10:10(-07), SpreadTooThin:
> I'm grepping through my C++ code for a delete that uses []
>
> How (in tcsh on MAC OS X) do I grep for that?
>
> grep [] *.cpp *.h
>
> doesn't work...
>
> grep "[]" *.cpp *.h
>
> doesn't work either....
[...]
grep -F '[]' *.cpp *.h
sometimes refered to as fgrep.
--
Stéphane
|
|
|
|