Question: I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include:

1. Running multiple commands.
2. Capture output for previous command.
3. Take some action/Run different command based on output of last command.

Any pointers will be appreciated.

Answer: 
Have you considered Java's built-in [`Process`](http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Process.html) class? You can retrieve the exit value of the command and get the output(s) of the shell.
Depending on what you are doing ANT is a good way to go. If you create an ant script you can then execute that script from within java. Ant would also be better supported on other environments