Ant run command with pipes

后端 未结 6 893
温柔的废话
温柔的废话 2020-12-13 19:25

I must to implement command : java -jar test.jar page.xml | mysql -u user -p base in ant. So i Have tried with this task:



        
6条回答
  •  感情败类
    2020-12-13 19:45

    The pipe (|) can only be used in a shell script. You're passing it as an argument to the java process.

    So you need to execute a shell script. You can do this by executing (say) bash -c and passing the above as a shell statement (albeit inline - you could write a separate script file but it seems a bit of an overhead here)

      
        
        
      
    

提交回复
热议问题