Re: Executing A Shell Script...
Re: Executing A Shell Script...
- Subject: Re: Executing A Shell Script...
- From: Chris Ridd <email@hidden>
- Date: Fri, 30 Aug 2002 15:30:24 +0100
On 30/8/02 3:21 pm, Albert Atkinson <email@hidden> wrote:
>
With NSTask you would do something like:
>
>
[myTask setLaunchPath:@"/bin/tcsh"];
>
>
[arguments addObject: @"mkdir /DirMade"];
>
>
[myTask setArguments:arguments];
No. You need to separate the arguments yourself (which avoids one of the
pitfalls in system()). Something like this:
[myTask setArguments: [NSArray arrayWithObjects: @"/bin/mkdir",
@"/DirMade",
nil]];
>
[myTask launch];
>
>
Correct?
>
>
Also, how would I get the output from this as said in my previous
>
message?
See the standardError and standardOutput methods.
>
Thanks!
>
>
Albert
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.