Help with Expect tool Script

Problem Description: I have written the Expect script in Linux box, able to login from Linux to Windows and able to execute the command(eg, hostname) on windows server which produces some value. I want to pass this value from Windows to Linux box . Can we pass any parameter from Linux with expect tool so that it passes the value from windows to Linux box.

Thanks,
Khagendra Lamsal

When an 'expect' statement is matched, the characters returned are in the expect_out() variable, which you can do what you like with. Use of expect_out is complicated and its values depend on what you tell the script to expect in the way of strings/regular expressions, so too much for here without any code snippets to work with

Thanks Jerry. Let me do some test over the weekend.