Version 1 of Don't Expect to sleep

Updated 2009-05-04 17:03:47 by LV

While sleep is a legitimate Expect command, it often appears out of confusion. Sometimes programmers perceive that an Expect script is unreliable, and try to help things along by introduction of a little delay; this is often a symptom of the root cause that they have misunderstood that for which they're waiting. They might have written

    expect Password
    sleep 1
    send $next_command\r

where they'd be far better served to write

    expect Password:
    send $next_command\r

Sometimes they simply don't understand expect's pattern-matching at all, and rely on cargo-cultish "dead reckoning" to express their Expect dialogues [L1 ].