Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am using the following code to get all the files with "#include" in cwd recursively(pls let me know if there is a better way).Whenever I run this code I get the below warnings.Has anyone faced such issue before?

my @grep_includes=`find.exe . -name "*" -print0 | xargs -0 grep -i #in +clude`; OUTPUT:- grep: ./files/tools/boot: Invalid request code grep: ./files/tools/boot/bin: Invalid request code grep: ./files/tools/usbdrivers: Invalid request code grep: ./files/tools/usbdrivers/win7: Invalid request code grep: ./files/tools/usbdrivers/xp: Invalid request code

Replies are listed 'Best First'.
Re: "Invalid request code "error
by Anonymous Monk on Mar 20, 2011 at 00:48 UTC
    That is an error message from the program grep, which is not perl

      The reason I am asking me when I run the below command

      "find.exe . -name "*" -print0 | xargs -0 grep -i #include"
      from any command window I dont see the grep error message ,only when I put it in a perl script and run I get this error message.So I thought something to do with perl.

      Does any one know if there is an yother way to get all the #includes in a given directory recursively?

        Can anyone help?

Re: "Invalid request code "error
by Anonymous Monk on May 23, 2019 at 06:49 UTC
    This is what I'm getting when trying to run grep from find on a directory. I can see your case is the same (./files/tools/boot, ./files/tools/boot/bin, ... are dirs). Use "! -type d" clause to filter them out -- or just ignore the warning, it doesn't seem to be harmful. ((NB Sorry for a late answer :-))