• 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: Using shell commands in an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using shell commands in an application


  • Subject: Re: Using shell commands in an application
  • From: Matt Judy <email@hidden>
  • Date: Fri, 05 Jul 2002 01:30:53 -0700

I wonder if this might work:

[myTask setLaunchPath:@"~/aFolder/myScript"];
[myTask setCurrentDirectoryPath:@"~/aFolder/"];

[myTask launch];

--Matt

Arthur VIGAN wrote:
Hi,

My application needs to use some shells commands to works: the aim is to
launch a shell script, but for that script to work, I have to be in the
directory where it is (I can't use /Users/arthur/aFolder/mySript to
execute). In the terminale, this would be:

% cd /Users/arthur/aFolder
% ./myScript

In my app I used the following, but it desn't work:

[myTask setLaunchPath:@"/bin/tcsh"];

[arguments addObject:[[NSString stringWithString:@"cd ~/aFolder"]
stringByExpandingTildeInPath]];

[arguments addObject:[NSString stringWithString:@"./myScript"]];

[myTask setArguments:arguments];

[myTask launch];

Where is the problem?

Thanks in advance.

Arthur
_______________________________________________
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.
_______________________________________________
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: 
 >Using shell commands in an application (From: Arthur VIGAN <email@hidden>)

  • Prev by Date: Re: Using shell commands in an application
  • Next by Date: stopping superview from responding
  • Previous by thread: Re: Using shell commands in an application
  • Next by thread: Re: Using shell commands in an application
  • Index(es):
    • Date
    • Thread