I have this Code:
func syncShellExec(path: String?) {
let script = [path!]
let process = Process()
let outputPipe = Pipe()
let filelHandler = outputPipe.fileHandleForReading
process.launchPath = "/bin/bash"
process.arguments = script
process.standardOutput = outputPipe
.
.
.
In Swift I call it this way:
self.syncShellExec(path: Bundle.main.path(forResource: "initial", ofType: "command"))
Now I want to add an Extra argument for the script itself (using Functions within the Bashscript). In Terminal it would be like this:
/usr/bin/bash initial.command Do_My_Function
How to add this to the process?