Re: How to know if the System Preferences app is running
Re: How to know if the System Preferences app is running
- Subject: Re: How to know if the System Preferences app is running
- From: Chris Ridd <email@hidden>
- Date: Tue, 26 Nov 2002 19:32:58 +0000
On 26/11/02 6:04 pm, TACKEL <email@hidden> wrote:
>
PS - Although it's not important using NSTask, the "grep" command I run inside
>
the task doesn't work. Do you know how I could run it? Is it necessary to
>
create
>
another task and pipe both tasks?
>
>
[checkTask setLaunchPath: @"/usr/bin/top"];
>
[checkTask setArguments:
>
[NSArray arrayWithObjects: @"-l1", @"|", @"grep", @"System\\ Pre", nil]];
Yes, create two tasks and pipe them together, which is what a Unix shell
would do.
What you're doing is the same as typing this at a shell prompt:
/usr/bin/top -l1 "|" grep "System Pre"
Read the man page for a shell to find out how it parses commands you give
it!
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.