title: Config and Run Ant from shell script
body: <p>I want to build my project with Ant(1.8) from terminal(I use ubuntu) and want to know following when my shell script is run.<br>
  1. How to set Ant_Home ? Not setting the path in bashrc or any other location, my script requires to set the Ant which is used to build the project. (it is because, some projects are run with Ant 1.7.)  </p>
  
  <ol start="2">
  <li><p>How to run couple of build.xml files sequentially (one after another if previously run build file is successfull) in my script. Moreover, let me know how I can pass parameters from terminal to the shell script so that the Ant home can be changed.  </p></li>
  <li><p>How my shell script know whether the build is successful in order to execute later commands.  </p></li>
  </ol>
  
  <p>EDIT: My expected shell script will be like this.I am very new to writing scripts and looking for something like below. </p>
  
  <pre><code>ANT_HOME = {#exact ant home path here or value passed from terminal at run time}
  ANT_BUILD_XML_FILE_1 #Define the build xml file. This values should be taken from the terminal inputs  
  ANT_BUILD_XML_FILE_2 #this values should be taken from the terminal inputs  
  set ANT_HOME #This line will load or call the ant home
  ant build -buildfile ANT_BUILD_XML_FILE_1 # run the ant build file
  if(#above build is successfull)
  ant build -buildfile ANT_BUILD_XML_FILE_2 #run the 2nd build file.
  
  if(#above build 2 is successful) 
  #some other command
  echo"projects and jars built successfully"
  </code></pre>