Use java as linux shell script language?

I used cshell / tcshell before and after calling python.

Now I'm going to combine all my shell scripts, gui, database, web pages. Python is good at most jobs, but it is relatively weak in the GUI, overall performance, and third-party libraries.

So, I'm going to try java as the main development language. Is this good for interactive shell programming, process control, etc.?

Many thanks.

+3
source share
4 answers

Java - , , ( , Java, , yack!).

! JVM, JRuby (ruby), Rhino (javascript), Jython (python), Groovy Grash, Bean -shell .., Java . Grash, , , , .

JVM (, Nailgun JRuby), . . Ruby (JRuby) .

+3

Groovy, Java .

+3

JVM ( ) () (), ....

+1

I wrote jpad to run shell java scripts and interactive snippets, while also providing a good visualization of the results. This shows what I mean:

JPad ​​Java REPL

To copy a file using this scripting language, you must use: http://jpad.io/example/1I/fileio

final File file = new File("outt.csv");
Object o = new int[] {1,2,3};
JPad.writeCsv(o, file);
java.nio.file.Files.copy(file.toPath(), Paths.get("copy.csv"));

What you can also run from the command line like:

> more fileio.jpad
final File file = new File("outt.csv");
Object o = new int[] {1,2,3};
JPad.writeCsv(o, file);
java.nio.file.Files.copy(file.toPath(), Paths.get("copy.csv"));
> jpad fileio.jpad
> dir
29/04/2017  13:30    <DIR>          .
29/04/2017  13:30    <DIR>          ..
29/04/2017  13:30                16 copy.csv
29/04/2017  13:30               160 fileio.jpad
29/04/2017  13:30                16 outt.csv
0
source

All Articles