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 " | awk -F: '{print $1}' | xargs grep "#include "
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 . Which is not what I want. Any suggestions?
else
for found in $LIST
do
grep $2 $found >& /dev/null
if [ $? -eq 0 ]
echo $found
fi
done
fi
exit 0
Reading the man page to grep should be a requirement. It already had the option I needed (just getting the filename). I will clean this thing up, and add the ability to search for as many terms as you need.