Calling SH Unix command via Java

By far, one of the most simple, yet overlooked simple solution to batch and process executions.

Running an SH via Java isn’t really hard – there’s already an existing Object Utility for it, just need to call it correctly though. Java Code:


the is a custom script I created using nano. Basically, I pass alvin jay and reyes as parameters and get them by using $1,2 and 3.


Console Output: I manage to get the output from the output stream object of the Process.


Download the source code here:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s