[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2906
  • Last Modified:

How to execute unix commands from ant script

Hi,

  I am not sure if this is the correct place to ask, but i din't find any other category for Ant.
I am looking to run my ant script (buil.xml) having some unix commands. I am able to execute the java commands successfully.

I am typically looking for an shell script like the below to convert it to an ant script
#!/bin/ksh
sort -t, -d -k 1,1 -k 2,2  ./output/abc.dat > ./output/abcsort.dat
sort -t, -d -k 1,1 -k 2,2  ./output/xyz.dat > ./output/xyz.sort.dat
(where the dat files were comma separated files which need to be sorted)

thanks,
H
0
hyder
Asked:
hyder
  • 3
1 Solution
 
shivsaCommented:
check this script from Oracle
http://otn.oracle.com/sample_code/tech/xml/survey/index.html

this execute shell script with exec.
0
 
shivsaCommented:
0
 
shivsaCommented:
any updates ???
0
 
ahoffmannCommented:
<exec executable="sort" os="whatever">
  <arg line="-t, -d -k 1,1 -k 2,2  ./output/abc.dat > ./output/abcsort.dat"/>
</exec>
0
 
liddlerCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by ahoffmann

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

liddler
EE Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now