• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTask - grep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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/


  • Follow-Ups:
    • Re: NSTask - grep
      • From: Art Isbell <email@hidden>
References: 
 >Re: NSTask - grep (From: "Simon Stapleton" <email@hidden>)

  • Prev by Date: Re: Graphics to PDF file?
  • Next by Date: Re: NSThread question - DO to make it sing
  • Previous by thread: Re: NSTask - grep
  • Next by thread: Re: NSTask - grep
  • Index(es):
    • Date
    • Thread