On Mon, 9 Jul 2001 15:27, Rohit Peyyeti wrote:
> > and then execute shell script with one parameter. The other way is to use
> > execon on /bin/sh executable and supply -c option so your commanline
> > looks like
> >
> > /bin/sh -c mysql -u rtest -h helix -P 3306 -prtest -D rtest < ...
>
> I tried doing this, but when I execute this with sh:
> [slogic@helix slogic]$ /bin/sh -c mysql -u rtest -h helix -P 3306 -prtest
> rtest < /var/www/test/data/slogicdatadump.sql
> ERROR 1045: Access denied for user: 'slogic@localhost' (Using password: NO)
>
> Where as without sh:
> ERROR 1045: Access denied for user: 'rtest@helix' (Using password: YES)
>
> Why is the difference? Thanks for the help!
oops - my error. It should be
/bin/sh -c "mysql -u rtest -h helix -P 3306 -prtest -D rtest < ..."
which I fear is not doable using execon (impossible to locate <srcfile>
inside another attribute ... unless I am mistaken). Which means you will be
forced to use a wrapper script for the moment. The next version of ant
released (1.4) but until then a wrapper script is your best option.
Cheers,
Pete
*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof." |
| - John Kenneth Galbraith |
*-----------------------------------------------------*