I try to call a Unix tool from my app but don't get any output from it...

I call /usr/bin/grep from a NSTask but nothing comes out of it, even if it works from the command line…
Sometimes feeding the input pipe of a NSTask from your application you need to close it to get the Unix tool starting to send any output…
In practice, this means you have to launch the task everytime you need some job done: you can't keep a task running and feeding it from time to time.
Changing to
NSUnbufferedIO environment variable doesn't affect Unix tools.