I want to run a shell script using NSTask. This script is designed such that it will first come out from its current operation (cd ..) then will perform other operations.
So two tasks needs to be performed using NSTask go to the directory where script is present using cd and then run shell script. I am using below code but its its launch path not accessible error.
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/bin/true"];
[task setArguments:[NSArray arrayWithObject:@"cd /Users/user/work/project_4th_Jul 3/DemoWork/scripts ; sh Demoinstaller.sh"]];
[task launch];
Any ideas how to achieve this.