Use the set script command to
Anyone can display entries in the scripts table. Root privileges are required to configure scripts and display script stanzas.
Also see the set user, set device, set chat, and set modem commands.
Enter the set script command as shown below to configure or edit a modem or login script:
set script name=name range=range s{1-24}="stanza-content"
Note that the stanza_content value is enclosed in quotation marks.
Enter the set script command as shown below to display entries in the script table:
set script range=range
Enter the set script command as shown below to display all the stanzas of a script:
set script name=name show=on
Enter the set script command as shown below to delete a script from a script table.
set script {rmscript=on name=name | rmscript=name
|
Command Field |
Description |
|
name |
Specifies the name of the script |
|
range |
Specifies one of the following:
|
|
rmscript |
Removes the script specified |
|
s{1-24}="stanza-content" |
Specifies the number of a script stanza (1 through 24) and the contents of the stanza. Note: The content of a stanza-content field must be enclosed in quotation marks. The contents can include any of the following commands: Anp Sets
Example: s1="A70" Bn Transmits a break signal n milliseconds long. If n is not specified, the length is 250 milliseconds. Example: s7="B100" Cn Sets carrier loss detection. If n=
Example: S2="C1" D+m Raises a modem signal. If m is
D-m Lowers a modem signal. If m is
E{string} Writes the string either to
This string can include any of the escape commands listed in Script Escape Commands, which follows this discussion. Example: S10="E{Please Log In}" Fn Pauses for n seconds and flushes input data. The default is 0. Example: s1="F10" Gs Immediately does one of the following, depending on the value of s. If s is
Example: s2="G7" Hs Sets the carrier lost (hang-up) recovery to stanza s, which is the number identifying another stanza or one of the following:
Example: s2="H+" M{string} Writes string to a modem Example: s2="M{at&f\c}" This string can include any of the escape commands listed in Script Escape Commands, which follows this discussion. Nb Changes the baud rate. The range is 50 to 115,200. Rates under 110 bps should be used only on expansion ports. Example: s4="N19200" Pn Pauses for n seconds. If you do not specify a value for n, the default is 1 second. Example: s5="P2" Qn Sets software flow control. If n is
Example: s5="Q0" Sn Defines the time to wait (timeout), in seconds, for a modem signal or input data Example: s2="S5" Ts Defines the timeout recovery state. If the time-out is exceeded, control is passed to this stanza. Example: s2="T8" Un Immediately executes the text of stanza n, as if it were inserted to replace this command. You can nest this command, up to a maximum of 10. Example: s2="U4" W+m Waits for a modem signal to go high. If m is
Example: s6="W+1" W-m Waits for a modem signal to go low. If m is
Example: s6="W-1" string[s] Defines the string and the stanza to jump to when the string is received on a communications line. The string can include any of the escape commands listed in Script Escape Commands, which follow this discussion. Example: s7="[abort]s22" |
This section describes the escape command you can use in E, M, and [] command strings.
|
Escape Command |
Description |
|
^c |
This is the character transmitted by an ASCII keyboard when the CTRL key is held down and the c key is pressed. |
|
\b |
Backspace |
|
\f |
Form feed |
|
\t |
Tab |
|
\n |
New line |
|
\r |
Return |
|
\\ |
Backslash |
|
}nnn |
Octal byte value nnn |
|
\xhh |
Hexadecimal byte value hh |
|
%n |
A variable, where n is
|
|
%p |
A variable, where p is an integer from 1 to 9. For login scripts, the value of p comes from the pn field on the set user command. For dialer scripts, parameters come from the pn field of the set device command. |
In this example, the set script command displays the entire script table.
set script
In this example, the set script command displays an entry in the script table.
set script range=4
In this example, the set script command displays all stanzas of the specified script:
set script name=testmodem show=on
In this example, the set script command creates a script called newname and assigns a character size of 8 and no parity.
set script name=newscript ra=4 s1="A80"
In this example, the set script command defines a login script.
set script name=loginscript
s1="P2[Login:]2 S10 T4"
s2="P1 M{%1\r} S1 [sword:]3 T4"
s3="M{%2\r} G5"
s4="E{login failed} G-"
s5="E{login complete} G+"