good to see this old util get some new light here.
Don Libes' Expect: A Surprisingly Underappreciated Unix Automation Tool
11–20 of 106 posts
Re: Don Libes' Expect: A Surprisingly Underappreciated Unix Automation Tool
#12Re: Don Libes' Expect: A Surprisingly Underappreciated Unix Automation Tool
#13Expect is cool, I have used it in the past as well as the expect perl module, but in my opinion is always a suboptimal way to automate things. It's always better and more robust to have a proper interface to script things instead of relying on matching brittle text/regex responses and timers and such. Of course sometimes it's not possible, so expect comes in handy.
I 100% agree. If I can use paramiko/fabric or something similar, I prefer it way more than expect. If you have a slave device over RS232, expect is probably your only option. But if that remote item is running sshd, you are way better off without expect.
Re: Don Libes' Expect: A Surprisingly Underappreciated Unix Automation Tool
#14Re: Don Libes' Expect: A Surprisingly Underappreciated Unix Automation Tool
#15Earlier quoted context omitted.
I 100% agree. If I can use paramiko/fabric or something similar, I prefer it way more than expect. If you have a slave device over RS232, expect is probably your only option. But if that remote item is running sshd, you are way better off without expect.
what's wrong with expect spawning ssh??
Re: Don Libes' Expect: A Surprisingly Underappreciated Unix Automation Tool
#16Earlier quoted context omitted.
what's wrong with expect spawning ssh??
I think expect is often used to have it enter username and password "interactively". But it's easier and more robust to just use the public-key auth facility that is built-in to ssh.
Hence keys silently not working without "correct" permissions, passwords not passable on the CLI, inconsistent type-yes-to-override behavior, and other user-hostile design choices.
I love openssh, but it's a real pain in the ass sometimes.
Re: Don Libes' Expect: A Surprisingly Underappreciated Unix Automation Tool
#17Re: Don Libes' Expect: A Surprisingly Underappreciated Unix Automation Tool
#18Maybe expect is not for me, but given the title, I would've loved to see maybe a couple paragraphs of why `expect` is underappreciated...that is, what do typical Unix programmers use instead, because they're ignorant of expect. Much easier for me to understand the perspective of ignorance :)
Re: Don Libes' Expect: A Surprisingly Underappreciated Unix Automation Tool
#19The only times I've needed to use expect was to drive weird non-scriptable telnet-based remote systems and to automate unpackaging of intentionally-broken vendor-supplied self-expanding software archives that require some level of interaction.
The point being if you want to create shortcuts to jump to specific locations in a man page or drive outdated appliances or open user-hostile zips, expect is the tool for you!