Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running a shell script from ANT

 
Ram Charan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to run two shell scripts in sequece from ANT. The first one sets up some environment variables and the second one uses them to run IDL compiler. Here is the sequence of steps

1) When I login to unix, i will be in csh
2) The fist script should run in ksh and sets up environment variables
3) The second scripts should also run in same ksh and execute IDL compile

I do this from command line and it works.
1) When I login to Unix, I am in csh, so I just change shell by typing sh
2) I run a build.xml (using ant) that runs following.


So, I added an other exec task before the above task to change the shell using this:


But when I run the build.xml, I see that the shell has not changed. My questions are:
1) how do I change unix shells from ANT? I tried invoking a wrapper script that changes the shell and calling it from ANT but it did not work.
2) If there is a way to setup/change environment variables of Unix from ANT, I think my problem is solved.

Any help is greatly appreciated.

Thanks,
Ram Charan
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18164
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably the easiest solution is to write another shell script that does all of the above and invoke it from Ant.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic