From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b5f6579e792a767d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!w1g2000prm.googlegroups.com!not-for-mail From: "RasikaSrinivasan@gmail.com" Newsgroups: comp.lang.ada Subject: Re: gnat expect - help please Date: Sat, 17 Jan 2009 15:35:24 -0800 (PST) Organization: http://groups.google.com Message-ID: <2590bbb5-3b6a-47db-9520-530a4bdd5bf7@w1g2000prm.googlegroups.com> References: <49724286.2060108@ipno.in2p3.fr> NNTP-Posting-Host: 98.216.109.119 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1232235328 28603 127.0.0.1 (17 Jan 2009 23:35:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 17 Jan 2009 23:35:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w1g2000prm.googlegroups.com; posting-host=98.216.109.119; posting-account=mZyFSQoAAABfOmklsh1d8TPbS2LncUKl User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:4393 Date: 2009-01-17T15:35:24-08:00 List-Id: On Jan 17, 3:41=A0pm, xavier grave wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > I have tried your program (I modified "Password:" to "password :" > because of my scp output) and I have also a timeout. May be this is > related that the output of the scp isn't on stdout but somewhere else ? > I tried to redirect to a file without much success. > > I have also tried with Err_To_Out set to true without much success. > > Maybe somebody else ? > Sorry for being so little helpful. > xavier > > RasikaSriniva...@gmail.com a =E9crit : > > > > > I have trouble with gnat.expect. Hope someone can spot what is wrong > > or wrong with my understanding : > > > The following is a sample program that illustrates the problem : > > > - I was expecting the prompt "Password" to be hidden ie between my > > process and the spawned process. instead i do see the prompt in my > > bash session. > > > - so my call to gnat.expect.expect always fails with a timeout. > > > - after such a timeout my bash session behaves strange (no echo) > > > pointers appreciated. > > > Environment - > > > gnat-gpl-2007-i686-gnu-linux-libc2.3-bin.tar.gz > > on Suse 10.2 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > with Text_Io; use Text_Io ; > > with System.Os_Lib ; > > with Gnat.Expect ; use Gnat.Expect ; > > > procedure Hello is > > > =A0 =A0Pd : Gnat.Expect.Process_Descriptor ; > > =A0 =A0Prompt : Gnat.Expect.Expect_Match ; > > begin > > > =A0 =A0Gnat.Expect.Non_Blocking_Spawn( Pd , > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= "scp" , > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= ( 1 =3D> new String'("hello") , > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A02 =3D> new > > String'("rs3@ichabod:bin/") )) ; > > =A0 =A0Gnat.Expect.Expect(Pd,Prompt,"Password:",Timeout=3D>10000) ; > > =A0 =A0if Prompt =3D Gnat.Expect.Expect_Timeout > > =A0 =A0 =A0then > > =A0 =A0 =A0 =A0 Put_Line("Command timedout") ; > > =A0 =A0 =A0else > > =A0 =A0 =A0 =A0 Put_Line(Gnat.Expect.Expect_Match'Image(Prompt)); > > =A0 =A0end if ; > > end Hello ; > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org > > iEYEARECAAYFAklyQoYACgkQVIZi0A5BZF7K0ACgvcSx5A3cu+Y02HlfrCOy4oeA > C/8AoJQNAHoJQuEiYbhX27a2X1E0uECW > =3DvL5W > -----END PGP SIGNATURE----- thanks for trying. i made some progress on windows xp but have not met with success yet. thanks, srini