Can't expect / unbuffer / etc. (whatever this is attempting to contrast itself with) be easily invoked directly from shell prompt or script too??
Okay, I guess you have to know more about how expect
is invoked to understand what they mean. One glance at the examples, comparing them, and all becomes clear:
#!/bin/sh
empty -f -i in -o out telnet foo.bar.com
empty -w -i out -o in "ogin:" "luser\n"
I didn't realize that expect required/expected (no pun intended) to be used in scripts with its own shebang line:
#!/usr/bin/expect
spawn telnet foo.bar.com
expect ogin {send luser\r}
That does make it less easy/normal to use expect within a shell script.
I was coming to the expect project from/for the unbuffer
command, which by contrast, is quite easy to include/use in a shell script -- almost the same as empty
, in fact. (Seems like almost a mismatch to have unbuffer
command in expect
toolkit then. Or is expect
command the only odd one out in that toolkit?)