PDA

View Full Version : Expect - Reading output into variables



chrisvaughanuk
February 4th, 2010, 09:19 PM
Hi,

I am writing a script that spawns a telnet session. I am trying to read the output of some of the telnet session into a variable if possible. E.g. I write a command similar to:

send $COMMAND
I would then like to read telnet's response to a variable so that I can run an IF statement on the output. Can anyone help please?

chewearn
February 5th, 2010, 12:02 PM
Something like this?

RETVALUE=`send $COMMAND`