Solved

How to execute unix commands from ant script

Posted on 2003-11-19
6
2,821 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA "SendKeys" Syntax for Multiple Keystrokes 7 103
has22 challenge 11 80
java ^ examples 8 62
Problem to event 3 79
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now