Run code from terminal [Linux]

You need to continue to use processing-java, using this procedure:

  1. Create a folder with the same name as the sketch (eg, testSketch)
  2. In Terminal change to that directory.
  3. Copy/paste this code:
echo 'size (600, 600);
strokeWeight(10);
point(300, 200);
strokeWeight(1);' > testSketch.pde | processing-java --sketch=/Users/yourName/testSketch --run

The code that you enter on the command line will be redirected to your sketch file, and then it will be run by processing-java after entering the name of its folder. This was done on a mac; you will have to test it on Linux.

Hit return and you should see this output:

1 Like