Run arbitrary Bash Script from Processing

Here is my function to run a linux bash script from processing sketch.

void OpenIt(String fileToOpen){ try { Process p = new ProcessBuilder(fileToOpen, "").start(); } catch(IOException ex) { System.out.println(ex); } println("opening " + fileToOpen); }

Just get your button or code event to launch the script like this:

OpenIt("/path/to/bashscript.sh");

Anyone else using Processing and bash together? I am going to be trying to get this to work on Android next, any tips?

Sign In or Register to comment.