user121560 Asked: 2012-05-19 07:46:48 +0800 CST2012-05-19 07:46:48 +0800 CST 2012-05-19 07:46:48 +0800 CST Sending content of a file in Expect 772 How Can I send the content of a file in Expect? Do I have to use cat command in a way? if yes how? lets say my file is called 1.txt. example: expect "Enter command to send:" {send "???? \r"} ???? --> content of the file 1.txt. linux unix expect 1 Answers Voted johnshen64 2012-05-19T08:16:59+08:002012-05-19T08:16:59+08:00 expect is just a tcl script app so you can do anything you can do in tcl, such as send [cat 1.txt] you can also open the file and read and write its content with tcl.
expect is just a tcl script app so you can do anything you can do in tcl, such as
send [cat 1.txt]
you can also open the file and read and write its content with tcl.