CGI script problem: Send/Expect command echo on webpage
Hi,
I am writing a CGI script which calls a perl script to remotely login to a machine using send/expect commands. Problem is that all those messages get printed on webpage. How to tackle these ? Kindly let me know..... Regards, Rajat Garg Student Stanford University |
assuming that you are using Apache, look for "Apache CGI howto" via google.com/linux.
|
Everything printed to stdout inside a CGI-script is sent to the browser. The browser tries to make something from it. I think you must do something like
my $reply=`MyExpectScript`; Note: use backticks!!!!! Now everything your script prints is put as a string in $reply. So the next code will be # do something with the data in $reply .... .... print "..... the results you want to see....." for instance if you just want to show all the lines on your screen for my $line (split(/\n/,$reply)) { print "$line<BR>\n"; } |
All times are GMT -5. The time now is 06:18 AM. |