I have to run the command to kill the process and the command is kill pgrep -f /dev
,I know that to run the command NSTask
is used
but how to run the above command with these special arguments and the pgrep -f /dev is in ``
I have tried this code
NSTask *task = [[NSTask alloc]init];
[task setLaunchPath:@"/bin/kill"];
[task setArguments:@[@"`",@"pgrep",@"-f",@"/dev",@"`" ];
[task launch];
Please tell how to write it properly,I know I have given arguments wrong. Thanks, Any help will be highly appreciated.