Difference between revisions of "Autoexpect"
(Created page with "'''Autoexpect''' is a built-in script with expecthttps://wiki.tbpindustries.com/index.php?title=Expect that auto-generates an expect script from watching a session, basica...") |
|||
Line 1: | Line 1: | ||
− | '''Autoexpect''' is a built-in script with expect[[https://wiki.tbpindustries.com/index.php?title=Expect]] that auto-generates an expect script from watching a session, basically autoexpect watches you interacting with another program and creates an Expect script that reproduces your interactions. | + | '''Autoexpect''' is a built-in script with expect [[https://wiki.tbpindustries.com/index.php?title=Expect]] that auto-generates an expect script from watching a session, basically autoexpect watches you interacting with another program and creates an Expect script that reproduces your interactions. |
just type <code>autoexpect</code> and a new session will start. autoexpect will then begin recording your interactions until you stop it. | just type <code>autoexpect</code> and a new session will start. autoexpect will then begin recording your interactions until you stop it. |
Revision as of 10:17, 10 May 2019
Autoexpect is a built-in script with expect [[1]] that auto-generates an expect script from watching a session, basically autoexpect watches you interacting with another program and creates an Expect script that reproduces your interactions.
just type autoexpect
and a new session will start. autoexpect will then begin recording your interactions until you stop it.
This has the downside of recording full output and putting them into an expect field. This can be avoided by using the - p
flag which will put auto expect into prompt mode. In this mode, autoexpect will only look for the the last line of program output - which is usually the prompt. This handles the date problem (see above) and most others.
See Also: Expect [[2]]