Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 76713 invoked from network); 27 Mar 2003 10:50:38 -0000 Received: from k101-11.bas1.dbn.dublin.eircom.net (HELO corvil.com.) (159.134.101.11) by daedalus.apache.org with SMTP; 27 Mar 2003 10:50:38 -0000 Received: from preilly.local.corvil.com (preilly.local.corvil.com [172.18.1.173]) by corvil.com. (8.12.5/8.12.5) with ESMTP id h2RAoopg037747 for ; Thu, 27 Mar 2003 10:50:50 GMT (envelope-from peter.reilly@corvil.com) Content-Type: text/plain; charset="iso-8859-1" From: peter reilly Organization: corvil To: Ant Users List Subject: Re: Shell Script Date: Thu, 27 Mar 2003 10:52:20 +0000 User-Agent: KMail/1.4.3 References: <3E82A43B.9070901@earthlink.net> <200303270909.34712.peter.reilly@corvil.com> In-Reply-To: <200303270909.34712.peter.reilly@corvil.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200303271052.20910.peter.reilly@corvil.com> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I should just repeat that if you can get sshexec to work your build script would be more portable and easier to understand. Also, I do not have access to a windows box at the moment so can only test on linux. Peter. On Thursday 27 March 2003 09:09, peter reilly wrote: > The "cannot allocate Pseudo-terminal" is just ssh > whineing that it is run by a program and not by > a terminal (or something that looks like a terminal) > > You may be hanging in the exec executable=3D"ssh" line > because you do not provide std input to ssh, It is now > waiting for input but none is provided..... > > I do not see server defined in your script. Also > there is no need to use both exec and shellscript (this > may be just an artifice of your testing). > > Here is a shell script that works for me. > > > > set -x > cd ~/tmp > ssh serv1 <<END > cd /tmp > ls -rlta | grep tt2 > END > > > > and the output is: > > ssh: > + cd /home/preilly/tmp > + ssh serv1 > Pseudo-terminal will not be allocated because stdin is not a terminal. > -rw-r--r-- 1 matt wheel 18624 Mar 13 18:09 tt2 > > BUILD SUCCESSFUL > > good luck, > > Peter > > On Thursday 27 March 2003 07:11, Michael Taft wrote: > > Thanks for your reply, Peter. > > > > I downloaded the shell script task, but I'm having trouble actually > > getting it to work properly with sourceforge.net > > > > I explained what I'm trying to do earlier (it's included at the botto= m > > of this email) so I won't repeat it here. Here's my target for trying= to > > accomplish this. > > > > > > > > > > > src=3D"${base.dir}/FJWeb.tar"/> > > > > > > > > > > > > > > > michaeltaft@jyotish.sourceforge.net:/home/groups/j/jy/jyotish/htdocs= /"/> > > > > > > > > > > > > > > > > > > > > > > ssh ${server} ./script.sh > > > > > > I realize that this is a clumsy attempt, but it's the best I can do a= t > > my level of understanding. The web_zip and scp exec both work fine. T= he > > ssh exec starts to work but it only connects me to sourceforge and th= en > > gets hung up. Looking at the dir2.txt file I see the following commen= t: > > Pseudo-terminal will not be allocated because stdin is not a terminal= =2E > > > > I'm not sure if that means it's not working at all, or if it just kno= ws > > not to open the terminal. In any case that's as far as I've been able= to > > get with this. > > > > Any help? > > > > peter reilly wrote: > > >Hi, > > >I have included the e-mail discussion on using shellscript and sshex= ec. > > > > > >shellscript can be received from CVS head of ant-contrib project > > >on sourceforge. > > > > > >http://sourceforge.net/projects/ant-contrib/ > > > > > >sshexec can be received from CVS head of ant. > > >Peter. > > > > > >--------------------------//------------------------------- > > > > > >it is of course a lot better to use than > > >for this. > > > > > >Also my example contained an error, it should be > > > > > ssh ${server} < > > cd /tmp > > > ls -lrta > > > END > > > ]]> > > > > > >Peter. > > > > > >On Friday 21 March 2003 16:45, Anderson, Rob H - VSCM wrote: > > >>If you use the sshexec task you do not need to have an ssh client o= n > > >> your local machine. Obviously, the remote machine needs to be runn= ing > > >> sshd. > > >> > > >> > >> username=3D"dude" > > >> keyfile=3D"${user.home}/.ssh/id_dsa" > > >> passphrase=3D"yo its a secret" > > >> command=3D"./remotesctipt.sh"/> > > >> > > >>If you want to execute an ant script on the remote machine you will > > >> need to install ant and the scripts on the remote machine. Then ru= n a > > >> task like the following > > >> > > >> > >> username=3D"dude" > > >> keyfile=3D"${user.home}/.ssh/id_dsa" > > >> passphrase=3D"yo its a secret" > > >> command=3D"cd path/to/build/file ; ant targetname"/> > > >> > > >>I hope this helps. > > >> > > >>-Rob Anderson > > >> > > >>-----Original Message----- > > >>From: peter reilly [mailto:peter.reilly@corvil.com] > > >>Sent: Friday, March 21, 2003 3:25 AM > > >>To: Ant Users List > > >>Subject: Re: SSH in ANT?!?! (WAS: RE: process on a remote server vi= a an > > >>ANT ?????) > > >> > > >> > > >>I do not have windows at the moment so take what > > >>I am saying with a grain of salt. > > >> > > >>The question is not really an ant question. So > > >>test everything at the command line first. > > >> > > >>I assume that there is a ssh deamon/service running on > > >>the remote machine and there is a ssh command line > > >>utility in your exec path. > > >> > > >>If the sshd on the remote machine is a the cygwin sshd > > >>and you have cygwin installed correctly on both machines > > >>the script should work as is. > > >> > > >>If cygwin sshd is installed on the remote machine but the > > >>local machine does not have cygwin but does have another > > >>ssh client cli program that can run in a bat file one can do > > >> > > >> > > >> > > >> > > >> ssh ${server} ./script.sh > > >> > > >> > > >>Other combinations you need to try yourself. > > >> > > >>Important to note that the ./script.sh is a file on the remote mach= ine. > > >> > > >>To run a script defined in the ant build file do: > > >> > > >> > > >> ssh ${server} < > >>cd /tmp > > >>ls -lrta > > >>END > > >> > > > > > >On Sunday 23 March 2003 23:52, Michael Taft wrote: > > >>Hello - > > >>I've been using Ant in a hobbyist capacity for about a year now. I = use > > >>it in jEdit to help me build my project. > > >> > > >>One thing I would like to do is automate the uploading of my websit= e > > >>materials to sourceforge. Currently, I have a single ant task that = tars > > >>them, gzips them, and then scps the whole lot to the home of my > > >>sourceforge site. That all works great. > > >> > > >>However, what I'd *really* like is to then be able to ssh into > > >>sourceforge, and unzip and untar the bundle. I created an executabl= e > > >>task for ssh and was easily able to connect. But the next stage is > > >>confusing me a little bit. What I need to do is execute three bash > > >>shell commands (cd blah blah, gunzip blah blah, and tar xf blah bla= h) > > >> on the remote server. > > >> > > >>Is there an executable task that does this? > > >> > > >>In looking at the list archive, I found something about a "shellscr= ipt" > > >>task that sounds right, but neither my copy of ant (both the very > > >> latest plugin for jEdit, and the other (also new) copy I have on m= y > > >> machine seem to implement this task. > > >> > > >>So, my questions are: > > >> > > >>1. Is "scriptshell" what I want? > > >>2. If not, what is. > > >>3. If so, where do I get it? > > >> > > >>Thanks in advance. > > >>M. > > >> > > >> > > >>-------------------------------------------------------------------= -- > > >>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > > >>For additional commands, e-mail: user-help@ant.apache.org > > > > > >--------------------------------------------------------------------= - > > >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > > >For additional commands, e-mail: user-help@ant.apache.org > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > > For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org