I submitted the following commands through the cmd window on a Windows 11 machine:
grep -r --include=*.c "return"
grep -r --include="*.c" return
grep --recursive --include=*.c return
None of these commands returned. A very similar question here in SuperUser showed exactly the first command, except with a different search pattern, that allegedly worked.
If I submit the following command while in the directory right above the source files, you can see that an error occurs:
C:> grep -r --include=*.c "return" *.c
grep: *.c: No such file or directory
I have also tried other variations. The grep command does NOT seem to recurse through the directories.
Is there something wrong with the syntax? Have I found a bug? I kind of need it to work.
*.C
maybe? What if you use--include="*.[Cc]"
?