I have a very odd issue with a method that contains an NSTask. In 10.7+ the functionality works absolutely fine and successfully executes, returning the result and copying the file to the desired directory.
When trying my application in 10.6.8 the NSTask seems to do nothing at all, in-fact no errors, or anything to give me a hint as to why it's not working. I've tried every possible angle to determine where the problem is and I'm tapped out of possibilites. :-/
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath: @"/bin/sh"];
NSArray *arguments = [NSArray arrayWithObjects: @"-c",
@"find /Data/*.jug/files/ -name thefile | head -n 1 | awk -v dir=\"$HOME/path/to/copy/to\" '{printf \"cp \\\"%s\\\" \\\"%s\\\"\\n\", $1, dir }' | sh", nil];
[task setArguments: arguments];
NSPipe *thePipe = [NSPipe pipe];
[task setStandardInput:[NSPipe pipe]];
[task setStandardOutput:thePipe];
[task launch];
[task waitUntilExit];
[task release];
If try the command via Terminal in 10.6.8 I get the results back that I would expect to get in my application. I'm at a total loss here and really hope someone can shed some light onto this issue and how to fix it.