bashj is a bash mutant with java support.
It gives to bash scripts the ability to use java libraries, functions and code.
The detailed documentation (installation, examples, syntax...) is available at this wiki page : http://fil.gonze.org/wikiPG/index.php/Project_bashj_:_a_bash_mutant_with_java_support .
To bash developers, bashj brings
. Readability in the java section (OO style)
. JVM efficiency for CPU intensive components
. modular extensibility using java packages
. floating point (double) values variable and evaluation functions
. Math tools
. Swing UI tools
. Inter process tools between multiple bash process (and java process)
. Host registry
...
Basic examples:
#!/usr/bin/bashj
echo Math.cos(0.5)
echo Math.hypot(3.0,4.0)
echo System.getProperty("java.runtime.version")
#!/usr/bin/bashj
#!java
public static int factorial(int n)
{if (n<=0) return(0);
if (n==1) return(1);
return(n*factorial(n-1));}
#!bashj
echo j.factorial(10)
Features
- java shell
- java
- bash
- script
- java reflection
- java introspection
- java interpreter
- interpreter
Follow bashj : a bash mutant with java support
User Reviews
-
Very interesting perspective