Anonymous user
Execute a system command: Difference between revisions
m
→{{header|Objective-C}}: modernize
(Added groovy version) |
m (→{{header|Objective-C}}: modernize) |
||
Line 821:
{
[[NSTask launchedTaskWithLaunchPath:@"/bin/ls"
arguments:@[
}</lang>
If you need to run a system command, invoke the shell:
Line 827:
{
[[NSTask launchedTaskWithLaunchPath:@"/bin/sh"
arguments:@[
waitUntilExit];
}</lang>
Line 840:
{
[[NSTask launchedTaskWithLaunchPath:@"/bin/sh"
arguments:@[
waitUntilExit];
}
Line 846:
int main(int argc, const char **argv)
{
@autoreleasepool {
runSystemCommand(@"ls");▼
}
▲ runSystemCommand(@"ls");
return 0;
}</lang>
|