Solved

How to execute unix commands from ant script

Posted on 2003-11-19
6
2,832 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
ASCII Non-Printable characters/codes and their HTML equivalents 6 143
canBalance challenge 34 105
scoreUp challenge 14 69
"Black Box" Testing of Control System Software 2 95
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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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