Posted to tcl by Bradipo at Mon Nov 14 17:38:56 GMT 2016view raw

  1. $ expect
  2. expect1.1> spawn ed /tmp/output.txt
  3. spawn ed /tmp/output.txt
  4. 6187
  5. expect1.2> expect "\r\n"
  6. /tmp/output.txt: No such file or directory
  7. expect1.3> send "a\r"
  8. expect1.4> expect "\r\n"
  9. a
  10. expect1.5> send "\"foo\""
  11. expect1.6> send "\r"
  12. expect1.7> expect "\r\n"
  13. "foo"
  14. expect1.8> send ".\r"
  15. expect1.9> expect "\r\n"
  16. .
  17. expect1.10> send "w\r"
  18. expect1.11> expect "\r\n"
  19. w
  20. 6
  21. expect1.12> send "q\r"
  22. expect1.13> expect EOF
  23. q
  24. expect1.14> exit
  25. $ cat /tmp/output.txt
  26. "foo"
  27.