From owner-freebsd-questions Tue Nov 14 22:29:00 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id WAA21482 for questions-outgoing; Tue, 14 Nov 1995 22:29:00 -0800 Received: from relay.hp.com (relay.hp.com [15.255.152.2]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id WAA21473 for ; Tue, 14 Nov 1995 22:28:58 -0800 Received: from hpautobo.aus.hp.com by relay.hp.com with ESMTP (1.37.109.16/15.5+ECS 3.3) id AA291436843; Tue, 14 Nov 1995 22:27:25 -0800 Message-Id: <199511150627.AA291436843@relay.hp.com> Received: by hpautobo.aus.hp.com (1.37.109.16/16.2) id AA135436836; Wed, 15 Nov 1995 17:27:16 +1100 From: M C Wong Subject: convert Expect's (spawn,send) into Perl equivalent ? Any guru out there? To: freebsd-questions@freefall.FreeBSD.org (freebsd-questions@freefall.cdrom.com) Date: Wed, 15 Nov 95 17:27:16 EDT Mailer: Elm [revision: 70.85] Sender: owner-questions@FreeBSD.ORG Precedence: bulk -----BEGIN PGP SIGNED MESSAGE----- Hi, I have a need to convert an Expect script to Perl equivalent and one of the things that I am stuck with is how one can achieve Expect's spawn, send and interact with Perl ? Specifically, one of the procs in my Expect script spawns a shell process and sends subsequent commands to that shell process. Also, at some point, I need to use interfact such that the spawned process' STDIN and STDOUT get `connected' back to the user's terminal, eg : if ( [ catch "spawn -noecho $shell_process" reason ] != 0 ) { puts "*** error: $reason" return 90 } . . . send "\r"; . . . # Note that I want the shell process to terminate after executing # in interactive mode, so I don't have to deal # with scanning for shell-prompt symbol and send an "exit\r". send "; exit\r"; interact . . . Does anyone have any suggestions ? Don't ask me why the conversion needs to take place in the fist place please, 8-((((. -----BEGIN PGP SIGNATURE----- Version: 2.6.2i iQCVAwUBMKmIPkmThh0X7Um5AQEDTQQAoXR20ZXBhsjoB4N+dN9EOn2CfZpDakyD 1BPyYqY+QFqN4yirCl6PbqEQ1vhnvKClp6ithsbk8j+TZ1+cHOsN3ZXiUIM+gEgw xGIFIy3Ym66U9o3FZS5HVtRoaS/4v21a7Z9SdMyXUvuMyusb/Icqugd/ehzbwCYZ rjVPbrYalLo= =Cu0Q -----END PGP SIGNATURE-----