Sending content of a file in Expect

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.


Solution 1:

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.