Thursday, September 19, 2013

How to use java in a standalone bash script

Bash is good for some scripting purposes and not so good for some others.

 If your skills are in java then you can use java within a script like below.

The catch is there is a small delay of a second or two for the javac (compilation) step but beyond that it works a treat.

 I found that this is great for mucking around renaming and moving files on a recent scripting task.