• 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: Executing A Shell Script...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Executing A Shell Script... (From: Albert Atkinson <email@hidden>)

  • Prev by Date: Re: Tracking files the right way
  • Next by Date: Re: Renaming source files
  • Previous by thread: Re: Executing A Shell Script...
  • Next by thread: Re: Executing A Shell Script...
  • Index(es):
    • Date
    • Thread