tip Command
Purpose
Connects to a remote system.
Syntax
tip [ -v ] [ - BaudRate ] { SystemName | PhoneNumber }
Description
The tip command connects to a remote system and allows you to work on the remote system as if logged in directly.
Either the SystemName parameter or the PhoneNumber parameter is required. The SystemName parameter specifies the name of a remote system to be contacted. The remote system must be defined in the /etc/remote file, or in the file specified by the REMOTE environment variable. The PhoneNumber parameter specifies the number to dial over a modem connection.
When the tip command is invoked with the SystemName parameter, it searches the remote file for an entry beginning with that system name. When the command is invoked with the PhoneNumber parameter, it searches the remote file for an entry of the form tipBaudRate, where BaudRate is the baud rate for the connection. If the -BaudRate flag is not used, the tip command looks for a tip1200 entry, because 1200 is the default baud rate.
The actions of the tip command can be controlled using flags, escape signals and variables. The tip command reads the /etc/remote file to find out how to contact a remote system and discover the escape-send sequence to use when communicating with that system. In addition, the command may check the /etc/phones file to find out a phone number for the remote system.
A tip user can create an individual remote file in the format of the /usr/lib/remote-file file, and then specify the file to use with the REMOTE environment variable. A user can also create an individual phones file in the format of the /usr/lib/phones-file file, and then specify the file to use with the PHONES environment variable. The tip command does not read the /usr/lib/remote-file file or /usr/lib/phones-file file by default, however. The default files that the tip command uses are the /etc/remote file and /etc/phones file.
A tip user can create a $HOME/.tiprc file to specify initial settings for the tip variables. In addition, settings made in the remote file, the phones file, and the .tiprc file can be overridden by using escape signals while tip is running. Escape signals can also be used, for instance, to start and stop file transfers or interrupt a connection to remote system.
The tip command uses lock files in the /etc/locks directory to lock devices against multiple access and to prevent multiple users from logging in on the same system.
When the tip command prompts for a response, edit the line as you type using the standard keys. Entering ~. (tilde, period) in response to a prompt, or pressing the Interrupt key, will abort the tip dialog and return you to the remote system.
You can use the tip command to transfer files to and from the remote system. You can use tip command escape signals to start and stop the file transfers. Several tip command variables work together to control file transfers.
File transfers usually use tandem mode to control the flow of data. If the remote system does not support tandem mode, set the echocheck variable to on to cause the tip command to synchronize with the remote system after transmitting each character. When transferring files with the ~< and ~> escape signals, use the eofread and eofwrite variables to specify the end of a file when writing, and recognize the end of a file when reading.
If the verbose variable is set on, the tip command performs the following:
- Writes a running count of the number of lines transferred during a file transfer.
- Writes messages indicating its actions as it dials a phone number.
You can use scripting to record the conversations you have with the tip command. Use the script variable to start scripting.
- Only a user with root user authority can change the dialtimeout variable.
- Although any user can specify a host at the command line, only the root user can change the host variable setting after the tip command has been started. However, this does not change the system to which the tip command is currently connected.
Flags
Item | Description |
---|---|
-v | Displays the settings of variables as they are read from the .tiprc file. |
-BaudRate | Overrides the default baud rate, which is 1200 baud. |
Escape Signals
Using escape signals, you can instruct the tip command to terminate, log off from the remote system, and transfer files. The escape character at the beginning of a line indicates an escape signal. The default escape character is a ~ (tilde). The character can be changed using the escape variable. All other typed characters are transmitted directly to the remote system. The tip command recognizes the following escape signals:
Item | Description |
---|---|
~^D~ | Terminates the connection and exits. You may still be logged in on the remote system; if so, you can issue another tip command to reconnect to that remote system. |
~c [Directory] | Changes, on the local system, to the directory specified by the Directory variable. If you do not include the Directory variable, the tip command changes to your home directory. |
~! | Escapes to a shell on the local system. When you exit from the shell, you return to the tip command. |
~> | Copies a file from the local system to the remote system. The tip command prompts you for the name of the local file. |
~< | Copies a file from the remote system to the local system. The tip command prompts you for the name of the remote file. |
A tip file download will only download the file until one of the EOF characters listed in the eofread command cariable is encountered. If one of these characters is not encountered, then the file copy will not succeed.
When downloading a file with the ~< signal, the user will be prompted for a local file name. The user may respond with any valid writeable file name. When prompted for the remote command, the user should append the EOF character to the end of the file being read.
This signal can be used as shown in the following example:
List command for remote system? echo "\04" | cat /etc/passwd
This
example assumes that the character 0x4
is present
in the tip eofread variable. The best way of ensuring
that this character exists in the variable is to assign it in the
usr's .tiprc file, which should reside in the user's home directory.
To accomplish this, the following command can be issued:
echo"eofread=\04" >> ~/.tiprc
Item | Description |
---|---|
~p Source [Dest] | Sends (puts) the Source file to a remote UNIX host system, using the cat command to copy the Source file to the Dest file. If the Dest file name is not specified, the cat command uses the name of the Source file. If the Dest file exists on the remote host, it will be replaced by the Source file. This signal is a UNIX-specific version of the ~> signal. |
~t Source [Dest] | Transfers (takes) the Source file from a remote UNIX host system to the local system, using the cat command to copy the Source file to the Dest file on the local system. If the Dest file name is not specified, the cat command uses the name of the Source file. If the Dest file exists on the local system, it will be replaced by the Source file. This signal is a UNIX-specific version of the ~< signal. |
~| | Pipes the output of a remote command to a local process. The command string sent to the local system is processed by the shell. |
A remote pipe will only succeed if the data from the remote pipe is terminated by one of the eof characters listed in the eofread tip command variable. If one of these characters is not encountered, then the output pipe will not succeed.
When piping remote output with the ~| signal, the user will be prompted for a local command name. The user may respond with any valid command name. When prompted for the remote command, the user should append the EOF character to the end of the file being read.
This signal can be used as shown in the following example:
Local command? cat
List command for remote system? echo
"asdfasdfasdfasdf\04"
This
example assumes that the character 0x4
is present
in the tip eofread variable. The
best way of ensuring that this character exists in the variable is
to assign it in the usr's .tiprc file, which should reside
in the user's home directory.
To accomplish this, the following command can be issued:
echo"eofread=\04" >> ~/.tiprc
Item | Description |
---|---|
~$ | Pipes the output of a local process to the remote system. The command string sent to the remote system is processed by the shell. |
~# | Sends a BREAK signal to the remote system. |
~s { Variable=Value | [!]BoolVariable | all | Variable? } | Sets or queries the tip command variables. To change the value of a non-Boolean variable, enter the variable name or abbreviation, followed by an = (equal sign), followed by the new value. For example, type ~s rc=^U to change the character used to turn uppercase conversion on or off (the raisechar variable). To change the value of a Boolean variable, enter the variable name or abbreviation. To reset the variable to its default value, type an ! (exclamation point) in front of the name. For example, type ~s !ec to reset the echocheck variable to its default value. To display all variables readable by the user, specify all as an argument to the ~s signal. You may also request the display of a specific variable by attaching a ? (question mark) to the variable name. For example, type the command ~s eol? to display the current end-of-line string (the eol variable). |
~^Z | Stops the tip command. The ~^Z signal is only available with job control. |
~^Y | Stops the local portion of the tip command. The remote portion, which displays the output from the remote system, continues to run. The ~^Y signal is only available with job control. |
~? | Displays a list of the escape signals. |
Variables
The tip command uses variables that control its operation. These variables may be numeric, string, character, or Boolean values. Some of these variables can be changed by any user who can run the tip command. However, the following variables can be changed only by a user with root user authority: the baudrate variable and the dialtimeout variable.
Variables may be initialized at run time in the $HOME/.tiprc file. Additionally, you can display and set the variables while already running the tip command by using the ~s escape signal.
Variables may be numeric, string, character, or Boolean values. To set a non-Boolean variable, enter the variable name or abbreviation followed by an = (equal sign) and the value. For example, type either ~s host=zeus or ~s ho=zeus to change the host name to zeus. In the .tiprc file, type host=zeus or ho=zeus.
To
change the value of a Boolean variable, enter the variable name or
abbreviation as an argument to the ~s signal or on a line of
the .tiprc file. To reset the variable to its default value,
type an !
(exclamation point) in front of the name.
For example, type ~s !echocheck to reset the echocheck variable
to its default value while running the tip command.
Following are the common variables, their types, abbreviations, and default values.
Variable (Abbreviation) | Type | Description |
---|---|---|
beautify (be) | Boolean | Instructs the tip command to discard unprintable characters when a session is being scripted. Does not discard characters specified with the exceptions variable. The default setting is on. |
baudrate (ba) | Numeric | Reflects the baud rate of the connection. Changing the value of this variable will not change the current baud setting of the connected tty device. |
dialtimeout (dial) | Numeric | Specifies the time in seconds that the tip command waits for a connection when dialing a phone number. The default is 60 seconds. The dialtimout setting can be changed only by someone with root user authority. |
echocheck (ec) | Boolean | Instructs the tip command to synchronize with the remote system during a file transfer by awaiting the echo of the last character transmitted before transmitting the next character. The default setting is off. |
eofread (eofr) | String | Specifies the set of characters that signifies end-of-transmission during a remote-to-local (~< or ~t) file transfer. |
eofwrite (eofw) | String | Specifies the string that is sent to indicate the end of a transmission during a local-to-remote (~> or~p) file transfer. |
eol (none) | String | Specifies the string that indicates the end of a line. The tip command recognizes escape signals only when they follow an end-of-line string. |
escape (es) | Character | Specifies the character prefix for escape signals. The default is ~ (tilde). |
etimeout (et) | Numeric | Specifies the time to wait for a response when the echocheck variable is set on. If the echo is not received within the designated time, the file transfer is discontinued. The default time is 28 seconds. |
exceptions (ex) | String | Specifies the set of characters that should not be discarded even when the beautify switch is set to on. The \t\n\f\b string is the default. |
force (fo) | Character | Specifies the character that is used to force literal data transmissions during binary transfers. The ^P character is the default. Literal data transmissions are off until the user types the character specified by the force variable. |
framesize (fr) | Numeric | Specifies the number of bytes to buffer between files system writes when receiving files from the remote system. |
host (ho) | String | Specifies the name of the remote system to which you were connected when the tip command was invoked. This variable cannot be changed. |
halfduplex (hdx) | Boolean | Toggles Half-duplex mode. The default setting is off. |
localecho (le) | Boolean | Toggles the Local-echo mode. The default setting is off. |
log (none) | String | Defines the file used to log dial-outs with the tip command. The default file is the /var/spool/uucp/.Admin/aculog file. The log file can be changed only by someone with root authority. |
Variable (Abbreviation) | Type | Description |
---|---|---|
parity (par) | String | Defines the parity for file transfers. Defaults to the following string: no parity, 8 data bits |
phones (none) | String | Specifies the name of the user's phone file. The file can have any valid file name and must be set up in the format of the /usr/lib/phones-file file. The default is the /etc/phones file. If a file is specified with the PHONES environment variable, it is used in place of (not in addition to) the /etc/phones file. |
prompt (pr) | Character | Specifies the character that indicates the end of the line on the remote host. This character is used to synchronize during data transfers. The tip command counts lines transferred during a file transfer, based on the number of times it receives the prompt character. The \n character is the default. |
raise (ra) | Boolean | When set to on, instructs the tip command to convert all lowercase letters to uppercase before transmitting them to the remote system. The default setting is off. |
raisechar (rc) | Character | Specifies a character that is used to toggle uppercase conversion. The ^A character is the default. |
rawftp (raw) | Boolean | If the rawftp variable is set to on, data is transmitted over the connection during a file transfer with no additional processing carried out. That is, when sending files, line-feeds are not mapped to line-feed/carriage carried out. |
record (rec) | String | Specifies the name of the file in which the tip command records the session script. The tip.record file is the default. The tip command places the file in the user's current directory on the local system. |
remote (none) | String | Specifies the name of the user's remote system definition file. The file can have any valid file name and must be set up in the format of the /usr/lib/remote-file file. The default is the /etc/remote file. If a file is specified with the REMOTE environment variable, it is used in place of (not in addition to) the /etc/remote file. |
script (sc) | Boolean | When the script switch is set on, the tip command records everything transmitted by the remote system in a file on the local system. The file name is specified by the record variable. If the beautify switch is set to on, only printable ASCII characters (those between 040 and 0177) will be recorded in the script file. The exceptions variable specifies unprintable characters that will be recorded even if the beautify switch is set to on. The default setting for the script switch is off. |
tabexpand (tab) | Boolean | Causes the tip command to expand tab characters to eight spaces during file transfers. The default setting is off. |
verbose (verb) | Boolean | When the verbose switch is set on, the tip command prints messages while dialing, shows the current number of lines transferred during a file transfer, and displays other status information about the connection. The default setting is on. |
SHELL (none) | String | Specifies the type of shell to use for the ~! signal. The default value is /usr/bin/sh or is taken from the environment. |
HOME (none) | String | Specifies the home directory to use for the ~c signal. The default value is taken from the environment. |
Examples
- To specify a baud rate
when making a direct connection, type:
This instructs the tip command to use baud rate of 300 when contacting remote system hera.tip -300 hera
- To use a modem to connect
to a remote system, type:
The tip command connects the local system to the remote system reached by the telephone number 343-2132, after dialing a 9 to reach an outside line.tip 9,343-2132
- To connect directly to
a remote system and display the variables, type: tip -v heraThe -v flag causes the tip command to display the values of the variables as it reads them from the $HOME/.tiprc file. If the .tiprc file contains the following settings:
then output from the -v flag is as follows:sc be rec=/home/jimk/callout
set script set beautify set record=/home/jimk/callout
Files
Item | Description |
---|---|
/usr/bin/tip | Contains the tip command. |
/etc/locks/* | Contains lock files that prevent multiple uses of devices and multiple calls to systems. |
/etc/remote | Contains system descriptions for the tip command. If the remote variable or the REMOTE environment variable is set, that file is used instead. |
/usr/lib/remote-file | Contains sample remote file. If theremote variable or the RECORD environment variable is set, that file is used instead. |
/etc/phones | Contains the telephone number database for the tip command. If the phones variable or the PHONES environment variable is set, that file is used instead. |
/usr/lib/phones-file | Contains the telephone number database for the tip command. If the phones variable or the PHONES environment variable is set, that file is used instead. |
$HOME/.tiprc | Defines initial settings for the tip command variables. |
tip.record | Contains the tip command scripts. By default, the file is stored in the current directory. The user can change the file name and directory using the record variable. |