Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
do you want to send the file or receive it? –  glenn jackman May 18 '12 at 17:19

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.