I have a large expect script that installs and initializes software on various networking equipment. Within the script, there are many places where user input and system output is recognized. I would like to be able to create a logfile of the entire session so i can save it. I can't figure out what is the best way to do it. I execute from UNIX.
I've tried to figure out how to use the UNIX "script -a <logfile>" to work from within my expect script, but have had no luck.
I'm also attempting to create a procedure to write everything to an output file, but I think this is going to be a mess because of duplicate data - i.e. when I match system output via expect, I would write the expect_out(buffer) to the log, but it will most likely write duplicates of what was already written from stdout.
Any ideas here?
I've tried to figure out how to use the UNIX "script -a <logfile>" to work from within my expect script, but have had no luck.
I'm also attempting to create a procedure to write everything to an output file, but I think this is going to be a mess because of duplicate data - i.e. when I match system output via expect, I would write the expect_out(buffer) to the log, but it will most likely write duplicates of what was already written from stdout.
Any ideas here?