Problem:
for filename in find %@ -name '*.%@'; do cat $filename 2>/dev/null | grep -o %@ ; done
The for filename part will separate file names by the space character, so if you want to search in a file "/Users/XXX/Desktop/Test/Classes/UI Animations/Constants.h", it would try and search "/Users/XXX/Desktop/Test/Classes/UI" and "Animations/Constants.h" and not find either.
Problem: for filename in
find %@ -name '*.%@'
; do cat $filename 2>/dev/null | grep -o %@ ; doneThe for filename part will separate file names by the space character, so if you want to search in a file "/Users/XXX/Desktop/Test/Classes/UI Animations/Constants.h", it would try and search "/Users/XXX/Desktop/Test/Classes/UI" and "Animations/Constants.h" and not find either.
Solution: find %@ -name '*.%@' -exec grep -o '%@' {} \;
This is a good deal faster and will use the whole filename as intended.