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

Using shell commands in an application


  • Subject: Using shell commands in an application
  • From: Arthur VIGAN <email@hidden>
  • Date: Fri, 05 Jul 2002 10:02:19 +0200

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.

  • Follow-Ups:
    • Re: Using shell commands in an application
      • From: Koen van der Drift <email@hidden>
    • Re: Using shell commands in an application
      • From: Matt Judy <email@hidden>
    • Re: Using shell commands in an application
      • From: Cryx <email@hidden>
    • Re: Using shell commands in an application
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: MOKit
  • Next by Date: FileMaker Cocoa dev-list?
  • Previous by thread: PB not letting me build modified code in MenuExtras!!
  • Next by thread: Re: Using shell commands in an application
  • Index(es):
    • Date
    • Thread