Quote:
Originally Posted by bkelly
I don't agree with that.
|
Unfortunately it is irrelevant. This is how it is working. I know you wanted something else, but grep can't read your mind (and even my mind).
Quote:
Originally Posted by bkelly
By specifying a file limitation, such as *.cpp
|
You can't specify a file limitation. As it was already explained, *.cpp will be expanded by the shell
before executing grep, so instead of *.cpp a list of files will be passed to grep. You can check it if you execute
set -xv before this grep command.
Quote:
Originally Posted by bkelly
As noted, and as I read the man page, it should work.
|
Unfortunately the command line parsing/evauluation is not part of grep (or any other command), it is made by the shell. This is some kind of preprocessing occurred unconditionally before the real execution. In windows this works differently.
To achieve what you need you need to implement something, because there is no such tool available (installed) by default. An example was already posted by smallpond.