Unused icon indicating copy to clipboard operation
Unused copied to clipboard

Directories with spaces in the name are not searched

Open NightIsland opened this issue 11 years ago • 1 comments

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.

NightIsland avatar Feb 19 '14 14:02 NightIsland

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

ik2wxx avatar Nov 03 '16 15:11 ik2wxx