Xerox -07W & -11W Printer User Manual


 
12-4
Creating A Script File
Script File Examples
Log On Script
To introduce scripting, here is an example of probably the most obvious task to
automate - logging on to a host computer over a network:
hrcv hold
pset network protocol "protocol" nodename "nodename" connect
hcmp 0,"login: "
put "dave_r"
hcmp 0,"password:"
put "pericom_r"
hcmp 0,"$ "
exit
The hrcv command on the first line will be necessary in most cases when checking
data from the host. Because characters (usually 1 only) from the host are normally
processed between lines of the script file, it is normally necessary to include a hrcv
hold command to stop this, i.e. to HOLD characters from being processed. This will
be in force EXCEPT during hcmp and hget commands, until another hrcv command
is encountered.
The pset command enables you to change most items on the Settings menus, and
also ‘CURRENT’ settings usually set by ESCape sequences. In this case it is
imitating what you would do in the New Connection dialog box in order to connect
to a remote host.
The hcmp command allows you to wait until specific character(s) are received
EXACTLY from the host. The number before the string specifies how many seconds
to wait for the characters. The ‘0’ as used here is an unlimited wait. (In practice it
would be better to use a non-zero value and check the system flag to see if the string
was received.)
The put command sends the specified characters to the host. The exit command
terminates the script file but does not QUIT TeemTalk.
Within this outline script it is necessary to provide the relevant entries for the system to
which connection is required. The second line defines the particular network interface
protocol and nodename being used and initiates the connection.
The put lines define the userid and password to be used as 'dave' and 'pericom'
respectively. The hcmp lines define the particular prompts provided by the host
system, at which points the userid and password can be sent to the host. It is vitally
important to ensure that the “string” to be waited for in each hcmp command is
EXACTLY what will be received from the host, otherwise the log-on will fail. It is