This is probably just due to my quotes, but I'm trying to get the following script up and running:
This is my command line:
find ./ -type f | xargs grep "#include <some.h>" | awk -F: '{print $1}' | xargs grep "#include <another.h>"
I'm trying to find a nested header that is giving me compiler errors (struct redefinition). I hate typing that command in for obvious reasons. However every time I run it in a script the $1 keeps expanding to: #include <some.h>. Which is not what I want. Any suggestions?
Thanks.
#!/bin/bash
PWD=`pwd`
LIST=`find $PWD -type f | xargs | grep $1 | awk -F: '{print $1}'`
for found in $LIST do
grep $2 $found
done
exit 0