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

NSTask - grep


  • Subject: NSTask - grep
  • From: Kent Glenn <email@hidden>
  • Date: Mon, 9 Jul 2001 15:00:46 -0700

I'm having some problems getting grep to work with NSTask. I've gotten NSTask to work with some of the examples for "ls" on this list. I have even gotten it to work partially with "grep".

I want to grep for a pattern in a directory, and it's sub-directories. If I use a file name instead of the wildcard '*', then it will work. When I try to use the wildcard, I get this message: "grep: /Users/kglenn/*: No such file or directory". If I execute the same command from Terminal, it works perfectly. I thought maybe I had to escape the '*' at first, but that didn't work.

NSTask *myTask=[[NSTask alloc] init];

[myTask setLaunchPath:@"/usr/bin/grep"];
[myTask setArguments:[NSArray arrayWithObjects:@"-r",@"somestring",@"/Users/kglenn/*",nil]];
[myTask launch];
[myTask release];


I know it's something stupid I'm doing. Thanks in advance for the help.

-----------------------------
Kent Glenn

"The best way to get a drink out of a Vogon is to stick your finger down his throat..."
- Douglas Adams


  • Follow-Ups:
    • Re: NSTask - grep
      • From: Andreas Monitzer <email@hidden>
  • Prev by Date: Re: NSTableView--responding to clicks
  • Next by Date: Missing CFSocket documentation?
  • Previous by thread: sstream & screen color query
  • Next by thread: Re: NSTask - grep
  • Index(es):
    • Date
    • Thread