RosettaCodeData/Task/Execute-a-system-command/Objective-C/execute-a-system-command-2.m

7 lines
149 B
Objective-C

void runSystemCommand(NSString *cmd)
{
[[NSTask launchedTaskWithLaunchPath:@"/bin/sh"
arguments:@[@"-c", cmd]]
waitUntilExit];
}