/ Published in: Objective C
Cocoa provides NSTask to run subprocesses. It can be used to run shell scripts, but all this manual pipe and file handling is a bit cumbersome. Fortunately, for a simple script, we can use the trusty old system and redirect its result to a file.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// We'll save the result in a temp file // Run the shell script // Returns path to last crash report or empty string ( [lastCrash length == 0] )
URL: http://parmanoir.com/Quickest_Way_to_Shell