jeffhodnett / Unused

A Mac app for checking Xcode projects for unused resources
1.38k stars 184 forks source link

Directories with spaces in the name are not searched #19

Open NightIsland opened 10 years ago

NightIsland commented 10 years ago

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.

Solution: find %@ -name '*.%@' -exec grep -o '%@' {} \;

This is a good deal faster and will use the whole filename as intended.

ik2wxx commented 8 years ago

Can you please post the entire 'NSString *cmd =' line, with parameters ? Tnx