The init command selects (Web site translator) an initialization string to
The init command selects an initialization string to be passed to the modem before dialing. The default for Hayes modems is “ATE0 Q0 V1 X1″, which turns on echoing of commands and long result codes, and selects blind dialing (no checking of dial tone). Modern modems have a good factory default configuration, so this is a little unnecessary, though it does no harm. The dial command sends the initialization string to the modem and dials up the remote system. The default dial command for Hayes modems is ATD. The echo command The echo command serves as a debugging aid. Calling echo on makes dip echo to the console everything it sends to the serial device. This can be turned off again by calling echo off. dip also allows you to leave script mode temporarily and enter terminal mode. In this mode, you can use dip just like any ordinary terminal program, writing the characters you type to the serial line, reading data from the serial line, and displaying the characters. To leave this mode, enter Ctrl-]. The get command The get command is dip’s way of setting a variable. The simplest form is to set a variable to a constant, as we did in cowslip.dip. You may, however, also prompt the user for input by specifying the keyword ask instead of a value: DIP> get $local ask Enter the value for $local: _ A third method is to obtain the value from the remote host. Bizarre as it seems at first, this is very useful in some cases. Some SLIP servers will not allow you to use your own IP address on the SLIP link, but will rather assign you one from a pool of addresses whenever you dial in, printing some message that informs you about the address you have been assigned. If the message looks something like “Your address: 192.168.5.74″, the following piece of dip code would let you pick up the address: # finish login wait address: 10 get $locip remote The print command This is the command used to echo text to the console from which dip was started. Any of dip’s variables may be used in print commands. Here’s an example: DIP> print Using port $port at speed $speed Using port ttyS3 at speed 38400 Variable names dip understands only a predefined set of variables. A variable name always begins with a dollar symbol and must be written in lowercase letters. The $local and $locip variables contain the local host’s name and IP address. When you store the canonical host- name in $local, dip will automatically attempt to resolve the hostname to an IP address and to store it in the $locip variable. A similar but backward process occurs when you assign an IP address to the $locip variable; dip will attempt to perform a reverse lookup to identify the name of the host and store it in the $local variable. The $remote and $rmtip variables operate in the same way for the remote host’s name and address. $mtu contains the MTU value for the connection. These five variables are the only ones that may be assigned values directly using the get command. A number of other variables are set as a result of the configuration commands bearing the same name, but may be used in print statements; these variables are $modem, $port, and $speed. $errlvl is the variable through which you can access the result of the last command executed. An error level of 0 indicates success, while a nonzero value denotes an error.