• 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
NSTask & GREP problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTask & GREP problems


  • Subject: NSTask & GREP problems
  • From: Duncan Campbell <email@hidden>
  • Date: Tue, 23 Aug 2005 14:04:16 +1000

Hey folks.

I'm having a go building a front-end to the unix "grep" command. I'm using the "Moriarity" sample app as a starting point and have got the basics working.

I am, however encountering some problems passing the wildcard character ('*') into my grep statement.

My problem is that i want to restrict the types of files I search within. To do this, you can execute something like the following in terminal:

grep -cr --include='*[.txt|.rtf]' 'texttosearchfor' /path/to/search/ within/

which would restrict searching to files with the .txt and .rtf extensions.

(note I use the "-c" flag here to force output of all files seached - this is just for testing purposes).

If I try to do the same with NSTask, it croaks on the "--include" bit, and it seems it's the wildcard char thats causing it. If i omit this piece, the code runs perfectly.

I have found the following post where someone reports the same problem:

http://cocoa.mamasam.com/COCOADEV/2001/07/1/3422.php

and was wondering if anyone has managed to solve this?

(There is an app called "MacGrep" that has source available, but the author's site no longer works)

Regards,

D.



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTask & GREP problems
      • From: Tom Harrington <email@hidden>
  • Prev by Date: Re: Partial redraw of NSTableView
  • Next by Date: Re: using bless to change boot device [yet again]
  • Previous by thread: bug while saving
  • Next by thread: Re: NSTask & GREP problems
  • Index(es):
    • Date
    • Thread