Saturday, August 22, 2009

Remote i/o with Expect

Hmm, remote input-output with Expect sounds exactly like where I'll be next week with expect scripts. However, the whole expect buffer concept doesn't sit well with me. I can tell it's powerful, once you grok it, but I'm not there and I doubt I need to get there: I'm good with sed and awk. I understand that the expect buffer holds both sides of the "conversation" without regard for local and remote, and that $expect_out(buffer) contains everything since the last match, but even so, I'm not able to get expect to filter just the way I want to view. On the other hand, I just splatted the whole output to sed and I'm done.

Seductive power tools, these sed and awk. And despite what my co-workers think, I'm not even all that good with them ... but I know how to look up 80% of what I need from sed1line and awk1line.txt, and I glean the rest from Google or from scripts I've already written. (Every once in a while, I'm really clever. The other days, I just refer back to what I did then.) Most of it is actually knowing regular expressions from studying man regexp in my youth. Now I'd probably just use txt2regex instead.

No comments:

Post a Comment