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