SUSE Linux iTOps Tube

Wednesday, May 9, 2012

Calling Shell script while executing antscript

Hi ,

Am trying to run a shell script inside antscript.



Its executing but the shell script is not working as expected.

kindly assist in this.


Code:


<exec executable="/bin/bash">

    <arg value="copy.sh"/>

    </exec>


this is the one am giving in antscript to invoke the shell script.



where as the the shell script contains




Code:


echo "Please select the environment for deployment [ QA, SIT , PROD ] "

read environ

rm -rf blahblah.properties

if  [[ "$environ" == QA ]]

 then



      cp -rf * /dest/

      echo "QA config file has been copied"

elif  [[ "$environ" == SIT ]]

  then

          cp -rf * /dest/

          echo "SIT Config file has been copied"

elif  [[ "$environ" == PROD ]]

    then

        cp -rf  * /dest/

        echo " PROD config file has been copied "

else

echo " Please enter the correct environment as mentioned in CAPS "

fi


It is executing only the echo and else part alone ... its not prompting for the user input ... any help would be really appreciated !!











No comments:

Post a Comment