Today is time for some examples of Expect (extension of Tcl/Tk) scripts that I use almost daily. The most common usage scenarios are:
- automating common login (never do this unless you don't care about the passwords aka lab passwords for machine that will be wiped anyway),
- adjusting the remote environment to your needs without the modifying permanently any files on the remote machine (for example because it will be rebuild from scratch next day),
- running tests and verifying results (like running a command waiting sometime and verifying if you got the result you wanted, repeating the whole sequence 1000 times or until the result is reached),
- running some macros while in the interactive mode,
All the scripts, including few a bit more specialized, can be found here.