Re: NSTask - grep
Re: NSTask - grep
- Subject: Re: NSTask - grep
- From: Markus Hitter <email@hidden>
- Date: Tue, 10 Jul 2001 18:46:32 +0200
Am Dienstag, 10. Juli 2001 um 10:34 schrieb Simon Stapleton:
This is sort of off-topic for development, but...
From: =?iso-8859-1?Q?Jean-Fran=E7ois_Veillette?= <email@hidden>
if you want the shell to do it's work, create a task on
'/bin/tcsh -c "/usr/bin/grep somestring /Users/kglenn/*"'
That way, tcsh should expand the wildcard(*) for you.
Ummm. No. That will only do the directory he's in, and I believe he was
after a subdirectory grep too.
grep somestring `find somedirectory -name "*"`
`find somedirectory -name "*"` and `find somedirectory`
give the same result. Even easier would be to use grep's "-r" switch to
search recursively:
grep -r somestring .
To access this from within C/ObjC code, the BSD layer has two simple and
well working calls: system() and popen(), see their man pages. Both
execute via the shell.
The only thing with these is, they block execution until they're
finished. That's bad or good depending on the context.
Enjoy,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/