Advice on which language to use Advice on which language to use shell shell

Advice on which language to use


I'd use a named pipe (FIFO) instead. You simply write your output to the pipe and let the application read it. I'm not sure if there is any other way to get a more live system than this.

I'd recommend Perl as the back-end.

EDIT:

named pipes are a special type of files on UNIX. The abbreviation FIFO stands for "First In First Out". On LINUX Journal you can find an interesting read about named pipes.

Perl is a very powerful scripting language with many ready-to-use modules which you can find on http://cpan.org. You can find some answers here on SO about how/where to start learning Perl.


The Web part of your application can easily read a file or a database, so you just need to make sure that your shell scripts are outputting something for your Java code to update.

For example, if you run your shell script like this

./myscript.sh > mylog.log

Then in your Java code (note that you should not have logic in your JSP), you can read in the file to determine the status of the update, and output the result to your JSP.

It would be better to read the data in from a database, but that would involve you changing your shell script to output the data to a database.


You could put shell script output to some storage on server. And use AJAX on the web page to poll the server and get updates from that storage to the page.

If you will decide to use JSF for web page creation I can recommend "a4j:poll" component from ajax2jsf library. It is very simple and straightforward. Very easy way to poll server from the web page.