ID photo of Ciro Santilli taken in 2013 right eyeCiro Santilli OurBigBook logoOurBigBook.com  Sponsor 中国独裁统治 China Dictatorship 新疆改造中心、六四事件、法轮功、郝海东、709大抓捕、2015巴拿马文件 邓家贵、低端人口、西藏骚乱
This pattern works well:
set prompt ">>> "
log_user 0
send "What is quantum field theory?\r"
expect -re "(.+)$prompt"
puts -nonewline [join [lrange [lmap line [split $expect_out(1,string) \n] {regsub {\r$} $line ""}] 1 end] "\n"]
Then stdout will contain only the output of the command and nothing else.
Bibliography:

Ancestors (12)

  1. Expect HOWTO
  2. Expect
  3. List of command line utilities
  4. Command line utility
  5. Command-line interface
  6. Computer user-interface
  7. Software
  8. Computer
  9. Information technology
  10. Area of technology
  11. Technology
  12. Home