Ha, TCL is like Perl in that there always seems to be a way to condense the code down into fewer lines -- ultimately to one really long, hard to read line!
In my script, I actually did something like the doWork proc you show... earlier in the script I had the user enters a command file name (just a list of expect commands), and once the script has the user running as root, it would source that file. This way I could set up lots of little command scripts, but the bulk of the program (reading host list, logging in, su-ing) was unchanged.
By the way, Mike reminded me that TCL stands for Tool Command Language (not Tool Control Language). That's what I get for trying to write from memory...
Ha, TCL is like Perl in that there always seems to be a way to condense the code down into fewer lines -- ultimately to one really long, hard to read line!
In my script, I actually did something like the doWork proc you show... earlier in the script I had the user enters a command file name (just a list of expect commands), and once the script has the user running as root, it would source that file. This way I could set up lots of little command scripts, but the bulk of the program (reading host list, logging in, su-ing) was unchanged.
By the way, Mike reminded me that TCL stands for Tool Command Language (not Tool Control Language). That's what I get for trying to write from memory...