5

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.

EEAA
  • 108,414
  • 18
  • 172
  • 242
user121560
  • 51
  • 1
  • 2

1 Answers1

4

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.

johnshen64
  • 5,747
  • 23
  • 17