Using shell commands in an application
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.