LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-08-2012, 02:22 PM   #1
rameshpaul_cog
LQ Newbie
 
Registered: May 2012
Posts: 19

Rep: Reputation: 0
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 !!
 
Old 05-08-2012, 07:10 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Try this at the top of your shell script
Code:
set -xv
This shows in detail exactly what the parser is doing.
(Try calling your shell script directly to see what to expect)
Does 'antscript' actually allow/work with interactive cmds like 'read' ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
executing perl script inside shell script scriptme101 Programming 3 04-11-2012 09:30 AM
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 07:58 PM
Shell script calling shell script - List of all nikunjbadjatya Programming 7 04-13-2011 06:27 PM
Calling a bash shell script from within another script dedman Linux - Software 7 04-24-2010 08:53 PM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration