Bug 3452 - I suggest to add "input" attribute for the task exec as "output".
Summary: I suggest to add "input" attribute for the task exec as "output".
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.4
Hardware: All All
: P1 enhancement (vote)
Target Milestone: 1.6
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-09-05 23:46 UTC by david_gu
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description david_gu 2001-09-05 23:46:54 UTC
By some case, we have to execute system command and redirect input/output to 
pecified files, such as initialize mysql database: 
  mysql < init_db.sql >log.txt
  
  To run this kind of command by Ant is not very convenient, Because Ant only 
support output redirect and doesn't support input redirect. we have to specify 
os and do as: 

  <exec executable="cmd" os="Windows 2000" output="log.txt">
    <arg line="/c mysql &lt; init_db.sql>
  </exec>
  <exec executable="/bin/sh" os="Linux" output="log.txt">
    <arg line="-c mysql &lt; init_db.sql>
  </exec>

  It's not convenient. my suggestion is to add "input" attribute for task exec. 
So that we can just write one line as:
  <exec executable="mysql" input="init_db.sql" output="log.txt" />
and run it any where.

  BTW, I met the problem for initialize mysql database in my project. If you 
have good suggestion. Please let me know.

Thanks & Best regards,
David
Comment 1 Gautam Guliani 2001-09-18 22:11:42 UTC
You should use the built-in sql task for this.
Look at the documentation at 
http://jakarta.apache.org/ant/manual/CoreTasks/sql.html
Comment 2 Stefan Bodewig 2001-09-27 05:09:07 UTC
while I agree that <exec> should handle input as well, this clearly is an
enhancement request, but not a blocker - so I've degraded it.
Comment 3 Conor MacNeill 2003-02-09 12:20:18 UTC
input redirection implemented for Ant 1.6