I've spent a fair amount of researching how to run a particular terminal/shell command from within Swift.
The issue is, I'm afraid to actually run any code unless I know what it does. (I've had very bad luck with executing terminal code in the past.)
I found this question which seems to show me how to run commands, but I'm completely new to Swift and I'd like to know what each line does.
What does each line of this code do?
let task = NSTask()
task.launchPath = "/bin/sh"
task.arguments = ["-c", "rm -rf ~/.Trash/*"]
task.launch()
task.waitUntilExit()