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,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!r15g2000prh.googlegroups.com!not-for-mail From: "RasikaSrinivasan@gmail.com" Newsgroups: comp.lang.ada Subject: gnat expect - help please Date: Fri, 16 Jan 2009 08:27:51 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 209.104.243.242 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1232123271 2888 127.0.0.1 (16 Jan 2009 16:27:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 Jan 2009 16:27:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r15g2000prh.googlegroups.com; posting-host=209.104.243.242; posting-account=mZyFSQoAAABfOmklsh1d8TPbS2LncUKl User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3388 Date: 2009-01-16T08:27:51-08:00 List-Id: 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 ================================================================ with Text_Io; use Text_Io ; with System.Os_Lib ; with Gnat.Expect ; use Gnat.Expect ; procedure Hello is Pd : Gnat.Expect.Process_Descriptor ; Prompt : Gnat.Expect.Expect_Match ; begin Gnat.Expect.Non_Blocking_Spawn( Pd , "scp" , ( 1 => new String'("hello") , 2 => new String'("rs3@ichabod:bin/") )) ; Gnat.Expect.Expect(Pd,Prompt,"Password:",Timeout=>10000) ; if Prompt = Gnat.Expect.Expect_Timeout then Put_Line("Command timedout") ; else Put_Line(Gnat.Expect.Expect_Match'Image(Prompt)); end if ; end Hello ;