Help needed in expect scripting.

Hi,

I am new to expect scripting and need your help in the following task.

I want an expect script to take the commands from an input file and then execute the commands and give the command execution output in an otput file.

The command execution part is normal and I did it via script by explicitly sending the command. But I need help in getting the commands in an input file and give the output in another file.

Any help is much appreciated.

Thanks,
Sooryaa.

should work

This is how i log the output into a file for verifying later..
Hope it helps u.

set fd [open "/tmp/outputFile" w ]

send "$query_cmd\r"
expect "success*#" {
puts $fd $expect_out(buffer)
send "\r" }