let pipe = $.NSPipe.pipe;
let file = pipe.fileHandleForReading; // NSFileHandle
let task = $.NSTask.alloc.init;
task.launchPath = path; //example '/bin/ps'
task.arguments = args; //example ['ax']
task.standardOutput = pipe; // if not specified, literally writes to file handles 1 and 2
task.standardError = pipe;
task.launch; // Run the command 'ps ax'
if(args[args.length - 1] !== "&"){
//if we aren't tasking this to run in the background, then try to read the output from the program
// this will hang our main program though for now
let data = file.readDataToEndOfFile; // NSData, potential to hang here?
file.closeFile;
response = $.NSString.alloc.initWithDataEncoding(data, $.NSUTF8StringEncoding).js;
}