Solved

How to execute unix commands from ant script

Posted on 2003-11-19
6
2,829 Views
Last Modified: 2013-12-26
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
Comment
Question by:hyder
  • 3
6 Comments
 
LVL 24

Expert Comment

by:shivsa
ID: 9783693
check this script from Oracle
http://otn.oracle.com/sample_code/tech/xml/survey/index.html

this execute shell script with exec.
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9783748
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9798452
any updates ???
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 250 total points
ID: 9799902
<exec executable="sort" os="whatever">
  <arg line="-t, -d -k 1,1 -k 2,2  ./output/abc.dat > ./output/abcsort.dat"/>
</exec>
0
 
LVL 18

Expert Comment

by:liddler
ID: 10191741
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question