This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Pipeline as Code and have Mohamed Labouardy on-line!
See this thread for details.
Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Using exec task

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am trying to run a script using the source command through the following build.xml:

<project name="Sample" default="test">
<target name="test">
<exec executable="source">
<arg line="/opt/bea/wlserver_10.3/server/bin/setWLSEnv.sh"/>
</exec>
</target>
</project>


I get the following error on running this:
Buildfile: build.xml

test:

BUILD FAILED
/home/ser/minu/test/build.xml:3: Execute failed: java.io.IOException: Cannot run program "source": java.io.IOException: error=2, No such file or directory

Total time: 0 seconds



Could anyone tell me what could be the problem?

Thanks in advance!
 
Minu Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, if instead I run the above script by directly typing the command on the prompt like this

source /opt/bea/wlserver_10.3/common/bin/commEnv.sh

it works fine.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The "executable" property of <exec> must be a an executable file. "source' is not an executable file, rather it is a command built into the shell. Besides, I doubt that sourcing a shell within an Ant script will get you what you want - the environment set by setWLSEnv.sh will not be retained for any subsequent shells that you invoke.
 
Minu Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
 
A teeny tiny vulgar attempt to get you to buy our stuff
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic