You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Eric Fetzer <el...@yahoo.com> on 2009/08/04 21:55:32 UTC

Calling CYGWIN from Ant in XP

I'm trying to call CYGWIN from Ant in XP unsuccessfully.  I need to run a shell script from winders that returns a value to me.  Tried:

    <exec dir="C:\cygwin" executable="Cygwin.bat" os="Windows XP" timeout="1000" outputproperty="returnValue">
      <arg line="/cygdrive/c/cygwin/home/myuser/myShellScript.sh"/>
    </exec>

I get:

BUILD FAILED
C:\BuildDeployScripts\testCYGWIN.xml:3: Execute failed: java.io.IOException: Crea
teProcess: Cygwin.bat /cygdrive/c/cygwin/home/myuser/myShellScript.sh error=2

Any help?

Thanks,
Eric


      

Re: Calling CYGWIN from Ant in XP

Posted by Eric Fetzer <el...@yahoo.com>.
Thanks for the response Martin.  I ended up going a different route before you replied.  I found sshexec and put the script directly on the Unix machine rather than leaving it in my Cygwin and it worked well.  Here's what I ended with:

<project default="main">
  <target name="main">
    <sshexec host="${unixBox}" username="${myUser}" password="${myPassword}" command="/home/myUser/myScript.sh" trust="true" outputproperty="${returnedInfo}">
    </sshexec>
    <echo message="The shell script returned: ${returnedInfo}" />
  </target>
</project>




________________________________
From: Martin Gainty <mg...@hotmail.com>
To: Ant Users List <us...@ant.apache.org>
Sent: Tuesday, August 4, 2009 7:30:07 PM
Subject: RE: Calling CYGWIN from Ant in XP


193 is missing extension
http://about-java-programming.blogspot.com/2007/02/javaioioexception-createprocess.html

i would try the ant rexec task
http://ant.apache.org/manual/OptionalTasks/rexec.html
make sure default port 512 conforms to rexec daemon on intended unix server

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Tue, 4 Aug 2009 14:08:06 -0700
> From: elstonkers@yahoo.com
> Subject: Re: Calling CYGWIN from Ant in XP
> To: user@ant.apache.org
> 
> Of course I had to fix the file so that it no longer called cygwin.bat since it's in that shell now (solve the problem of getting to the shell later)...  So running inside the cygwin shell, running:
> 
> <exec dir="/cygwin/home/myuser" executable="myShellScript.sh" timeout="1000" outputproperty="returnValue"/>
> 
> I get:
> 
> BUILD FAILED
> c:\cygwin\home\myuser\testCYGWIN.xml:3: Execute failed: java.io.IOException: CreateProcess: myShellScript.sh error=193
> 
> So is there another way to call a unix shell script from windows (locally or on another machine) and gather the return that works?
> 
> Thanks,
> Eric
> 
> 
> ________________________________
> From: Eric Fetzer <el...@yahoo.com>
> To: Ant Users List <us...@ant.apache.org>
> Sent: Tuesday, August 4, 2009 2:42:40 PM
> Subject: Re: Calling CYGWIN from Ant in XP
> 
> Maybe a different issue is under this.  When I run the same build file directly in cygwin, I get the same error.  From the command line it's fine though.  Does this make more sense?
> 
> 
> 
> 
> ________________________________
> From: Eric Fetzer <el...@yahoo.com>
> To: Ant Users <us...@ant.apache.org>
> Sent: Tuesday, August 4, 2009 1:55:32 PM
> Subject: Calling CYGWIN from Ant in XP
> 
> I'm trying to call CYGWIN from Ant in XP unsuccessfully.  I need to run a shell script from winders that returns a value to me.  Tried:
> 
>    <exec dir="C:\cygwin" executable="Cygwin.bat" os="Windows XP" timeout="1000" outputproperty="returnValue">
>      <arg line="/cygdrive/c/cygwin/home/myuser/myShellScript.sh"/>
>    </exec>
> 
> I get:
> 
> BUILD FAILED
> C:\BuildDeployScripts\testCYGWIN.xml:3: Execute failed: java.io.IOException: Crea
> teProcess: Cygwin.bat /cygdrive/c/cygwin/home/myuser/myShellScript.sh error=2
> 
> Any help?
> 
> Thanks,
> Eric
> 
> 
>      

_________________________________________________________________
Get back to school stuff for them and cashback for you.
http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1


      

RE: Calling CYGWIN from Ant in XP

Posted by Martin Gainty <mg...@hotmail.com>.
193 is missing extension
http://about-java-programming.blogspot.com/2007/02/javaioioexception-createprocess.html

i would try the ant rexec task
http://ant.apache.org/manual/OptionalTasks/rexec.html
make sure default port 512 conforms to rexec daemon on intended unix server

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Tue, 4 Aug 2009 14:08:06 -0700
> From: elstonkers@yahoo.com
> Subject: Re: Calling CYGWIN from Ant in XP
> To: user@ant.apache.org
> 
> Of course I had to fix the file so that it no longer called cygwin.bat since it's in that shell now (solve the problem of getting to the shell later)...  So running inside the cygwin shell, running:
> 
> <exec dir="/cygwin/home/myuser" executable="myShellScript.sh" timeout="1000" outputproperty="returnValue"/>
> 
> I get:
> 
> BUILD FAILED
> c:\cygwin\home\myuser\testCYGWIN.xml:3: Execute failed: java.io.IOException: CreateProcess: myShellScript.sh error=193
> 
> So is there another way to call a unix shell script from windows (locally or on another machine) and gather the return that works?
> 
> Thanks,
> Eric
> 
> 
> ________________________________
> From: Eric Fetzer <el...@yahoo.com>
> To: Ant Users List <us...@ant.apache.org>
> Sent: Tuesday, August 4, 2009 2:42:40 PM
> Subject: Re: Calling CYGWIN from Ant in XP
> 
> Maybe a different issue is under this.  When I run the same build file directly in cygwin, I get the same error.  From the command line it's fine though.  Does this make more sense?
> 
> 
> 
> 
> ________________________________
> From: Eric Fetzer <el...@yahoo.com>
> To: Ant Users <us...@ant.apache.org>
> Sent: Tuesday, August 4, 2009 1:55:32 PM
> Subject: Calling CYGWIN from Ant in XP
> 
> I'm trying to call CYGWIN from Ant in XP unsuccessfully.  I need to run a shell script from winders that returns a value to me.  Tried:
> 
>     <exec dir="C:\cygwin" executable="Cygwin.bat" os="Windows XP" timeout="1000" outputproperty="returnValue">
>       <arg line="/cygdrive/c/cygwin/home/myuser/myShellScript.sh"/>
>     </exec>
> 
> I get:
> 
> BUILD FAILED
> C:\BuildDeployScripts\testCYGWIN.xml:3: Execute failed: java.io.IOException: Crea
> teProcess: Cygwin.bat /cygdrive/c/cygwin/home/myuser/myShellScript.sh error=2
> 
> Any help?
> 
> Thanks,
> Eric
> 
> 
>       

_________________________________________________________________
Get back to school stuff for them and cashback for you.
http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1

Re: Calling CYGWIN from Ant in XP

Posted by Eric Fetzer <el...@yahoo.com>.
Of course I had to fix the file so that it no longer called cygwin.bat since it's in that shell now (solve the problem of getting to the shell later)...  So running inside the cygwin shell, running:

<exec dir="/cygwin/home/myuser" executable="myShellScript.sh" timeout="1000" outputproperty="returnValue"/>

I get:

BUILD FAILED
c:\cygwin\home\myuser\testCYGWIN.xml:3: Execute failed: java.io.IOException: CreateProcess: myShellScript.sh error=193

So is there another way to call a unix shell script from windows (locally or on another machine) and gather the return that works?

Thanks,
Eric


________________________________
From: Eric Fetzer <el...@yahoo.com>
To: Ant Users List <us...@ant.apache.org>
Sent: Tuesday, August 4, 2009 2:42:40 PM
Subject: Re: Calling CYGWIN from Ant in XP

Maybe a different issue is under this.  When I run the same build file directly in cygwin, I get the same error.  From the command line it's fine though.  Does this make more sense?




________________________________
From: Eric Fetzer <el...@yahoo.com>
To: Ant Users <us...@ant.apache.org>
Sent: Tuesday, August 4, 2009 1:55:32 PM
Subject: Calling CYGWIN from Ant in XP

I'm trying to call CYGWIN from Ant in XP unsuccessfully.  I need to run a shell script from winders that returns a value to me.  Tried:

    <exec dir="C:\cygwin" executable="Cygwin.bat" os="Windows XP" timeout="1000" outputproperty="returnValue">
      <arg line="/cygdrive/c/cygwin/home/myuser/myShellScript.sh"/>
    </exec>

I get:

BUILD FAILED
C:\BuildDeployScripts\testCYGWIN.xml:3: Execute failed: java.io.IOException: Crea
teProcess: Cygwin.bat /cygdrive/c/cygwin/home/myuser/myShellScript.sh error=2

Any help?

Thanks,
Eric


      

Re: Calling CYGWIN from Ant in XP

Posted by Eric Fetzer <el...@yahoo.com>.
Maybe a different issue is under this.  When I run the same build file directly in cygwin, I get the same error.  From the command line it's fine though.  Does this make more sense?




________________________________
From: Eric Fetzer <el...@yahoo.com>
To: Ant Users <us...@ant.apache.org>
Sent: Tuesday, August 4, 2009 1:55:32 PM
Subject: Calling CYGWIN from Ant in XP

I'm trying to call CYGWIN from Ant in XP unsuccessfully.  I need to run a shell script from winders that returns a value to me.  Tried:

    <exec dir="C:\cygwin" executable="Cygwin.bat" os="Windows XP" timeout="1000" outputproperty="returnValue">
      <arg line="/cygdrive/c/cygwin/home/myuser/myShellScript.sh"/>
    </exec>

I get:

BUILD FAILED
C:\BuildDeployScripts\testCYGWIN.xml:3: Execute failed: java.io.IOException: Crea
teProcess: Cygwin.bat /cygdrive/c/cygwin/home/myuser/myShellScript.sh error=2

Any help?

Thanks,
Eric