Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 932B6108D6 for ; Fri, 11 Oct 2013 18:43:39 +0000 (UTC) Received: (qmail 11427 invoked by uid 500); 11 Oct 2013 18:43:35 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 11138 invoked by uid 500); 11 Oct 2013 18:43:33 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 11128 invoked by uid 99); 11 Oct 2013 18:43:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Oct 2013 18:43:32 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [64.182.101.210] (HELO box4.7wei.com) (64.182.101.210) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Oct 2013 18:43:26 +0000 Received: from thunder.liderbug.com (mail.liderbug.com [65.102.82.20]) (authenticated bits=0) by box4.7wei.com (8.13.8/8.13.8) with ESMTP id r9BIh6nJ004993 for ; Fri, 11 Oct 2013 14:43:07 -0400 X-SPAM-Abuse: If this is Spam, please report it to the following link: X-SPAM-Report: http://www.dnsExit.com/Direct.sv?cmd=reportSpam&msgid=r9BIh6nJ004993 X-Service-By: http://www.dnsExit.com/Direct.sv?cmd=mailRelay Relay account will be suspended instantly if Spam Message-ID: <525846B7.3030701@blackforest-co.com> Date: Fri, 11 Oct 2013 12:43:03 -0600 From: Chuck Lidderdale User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: users@httpd.apache.org References: <52560F7E.1060209@blackforest-co.com> <1381393999.42977.YahooMailNeo@web121605.mail.ne1.yahoo.com> In-Reply-To: <1381393999.42977.YahooMailNeo@web121605.mail.ne1.yahoo.com> Content-Type: multipart/alternative; boundary="------------020308030404090407090107" X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Trying to run expect from web page --------------020308030404090407090107 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Guess I didn't explain my problem clearly enough. I'm unable to execute a an expect script via a web page. The page executes but the line with expect acts as if it's commented out or as if httpd.conf is missing something that allows expect to run. I've tried (via page.php): exec("thescript... exec ("sudo... exec("exec.bash.that.runs.expect. a href=cgi-bin/xyz.cgi ClickHere (with /usr/bin/expect myscript.exp). nothing. However running the expect script from the command line works. SOLVED** in php: $out = shell_exec ("/script.exp"); in script.exp: #!/usr/bin/expect -f set timeout 10 spawn telnet expect ... send... Found something on the web saying Apache/browser(?) doesn't like how expect starts out - need to strip script down and do the spawn bit. Any who life is good. chuck --------------020308030404090407090107 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Guess I didn't explain my problem clearly enough.  I'm unable to execute a an expect script via a web page.  The page executes but the line with expect acts as if it's commented out or as if httpd.conf is missing something that allows expect to run.
 I've tried (via page.php):
exec("thescript...
exec ("sudo... 
exec("exec.bash.that.runs.expect.
a href=cgi-bin/xyz.cgi ClickHere  (with /usr/bin/expect <path>myscript.exp).

nothing.  However running the expect script from the command line works.

SOLVED**

in php:  $out = shell_exec ("<path>/script.exp");

in script.exp:
#!/usr/bin/expect -f 
set timeout 10
spawn telnet <ipaddress>
expect ...
send...

Found something on the web saying Apache/browser(?) doesn't like how expect starts out - need to strip script down and do the spawn bit.  Any who life is good.

chuck



--------------020308030404090407090107--