Previous Topic

Next Topic

Book Contents

Book Index

Common edit changes made to Autoexpect recorded scripts

Once a script is recorded and imported into EnterpriseSCHEDULE it is common to make edit changes. The scripts generated are a combination of paired lines that begin with "send " and "expect " whereby "send" is the what Expect feeds to the recorded program and "expect" is the output generated from the recorded program.

A "send " response can be changed into Job parameters and/or Schedule variables including date variables. The dynamic token substitution can be added to the autoexpect session, for example:

You could use a Job parameter such as parameter 1

send -- "((P1))\r"

You could use a Schedule variable

Send – "((endofmonth))\r"

where endofmonth is a variable in the same directory as the job.

For previewing the outcome that the commands will be after dynamic token substitution of variables and parameters

Schedule preprocess {jobname}

If 'P1' was 'Hello world', then "preprocess" would return

send – "Hello world\r"

See Also

Appendix C - Using expect with EnterpriseSCHEDULE

General guidelines

Using expect’s record feature to capture an interactive session

What to remove from the expect line?

Breaking expect Jobs into reusable pieces using include within a Job

Creating Expect prototype Job Templates