ntip.1 11.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
.\" Copyright (c) 1980, 1990, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"	@(#)tip.1	8.4 (Berkeley) 4/18/94
.\"
34 35
.Dd December 26, 2000
.Dt NTIP 1
36 37
.Os BSD 4
.Sh NAME
38 39
.Nm ntip
.Nd connect to a directly-connected remote system
40
.Sh SYNOPSIS
41 42 43
.Nm ntip
.Op Fl c
.Op Fl r
44 45 46 47
.Op Fl v
.Fl Ns Ns Ar speed 
.Ar system\-name
.Sh DESCRIPTION
48 49
.Nm Ntip
establishes a full-duplex connection to another machine,
50 51 52 53
giving the appearance of being logged in directly on the
remote cpu.  It goes without saying that you must have a login
on the machine (or equivalent) to which you wish to connect.
.Pp
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
.Nm Ntip
differs from the traditional
.Nm tip
in a number of ways:
.Bl -enum
.It
It does not support calling a remote system,
all auto-dialing code has been removed.
.It
All the cheezy file transfer support has been removed.
.It
Most of the tilde escapes have been removed.  Mostly these were the file
trasfer related ones.  See below for what remains.
.It
.Nm Ntip
ignores 90% of the
.Xr remote 5
capabilities.  You can set the baud rate (br) and the device (dv).
Period.
.It
All of
.Nm tips
variables are still present, but most don't do anything.
It is left as an exercise to the interested user to differentiate.
.It
By default, it operates in ``raw'' mode instead of the usual ``cbreak'' mode.
This means that all input processing (if any) is performed by the remote system.
Raw mode also disables ``raisechar'' and ``force'' variable interpretation.
Yes, you can actually run emacs on an
.Nm ntip
line (modulo the '~' thing).
.It
.Nm Tip
is the poster-child for fork-without-exec,
creating separate reader and writer processes executing ``the same code.''
.Nm Ntip
is a child of convenience and consists of a single process using
.Xr select 2 .
.It
.Nm Ntip
no longer uses
.Xr uucp 1
style locking.
It relies on the TIOCEXCL ioctl (see
.Xr tty 4 )
to provide ``reasonably mutually exclusive'' access.
While it is still technically possible that two parties could open the
same line and both get ``exclusive'' access to it,
we consider this to be the source of amusing anecdotes rather than a bug.
.El
.Pp
105 106
Available Option:
.Bl -tag -width indent
107 108 109 110 111 112 113 114 115 116 117 118
.It Fl c
Force
.Nm ntip
to use ``cbreak''
(``(c)onventional'', ``(c)razy'', ``(c)an't run emacs'')
mode.
.It Fl r
Force
.Nm ntip
to use ``raw''
(``(r)ocks!'', ``(r)ulz!'', ``(r)ighteous'')
mode.
119 120
.It Fl v
Set verbose mode.
121
Whatever the hell that is.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
.El
.Pp
Typed characters are normally transmitted directly to the remote
machine (which does the echoing as well).  A tilde (`~') appearing
as the first character of a line is an escape signal; the following
are recognized:
.Bl -tag -width flag
.It Ic \&~^D No or Ic \&~ .
Drop the connection and exit
(you may still be logged in on the
remote machine).
.It Ic \&~c Op Ar name 
Change directory to
.Ar name
(no argument
implies change to your home directory).
.It Ic \&~!
Escape to a shell (exiting the shell will
return you to tip).
.It Ic \&~#
Send a
.Dv BREAK
to the remote system.
For systems which don't support the
necessary
.Ar ioctl
call the break is simulated by a sequence of line speed changes
and
.Dv DEL
characters.
.It Ic \&~s
Set a variable (see the discussion below).
.It Ic \&~^Z
Stop
156
.Nm ntip
157 158 159
(only available with job control).
.It Ic \&~^Y
Stop only the ``local side'' of
160
.Nm ntip
161 162
(only available with job control);
the ``remote side'' of
163
.Nm ntip  ,
164 165 166 167 168
the side that displays output from the remote host, is left running.
.It Ic \&~?
Get a summary of the tilde escapes
.El
.Pp
169
.Nm Ntip
170 171 172 173 174 175 176 177 178 179 180 181 182 183
uses the file
.Pa /etc/remote
to find how to reach a particular
system and to find out how it should operate while talking
to the system;
refer to
.Xr remote  5
for a full description.
Each system has a default baud rate with which to
establish a connection.  If this value is not suitable, the baud rate
to be used may be specified on the command line, e.g.
.Ql "tip -300 mds" .
.Pp
When
184 185 186
.Nm ntip
prompts for an argument (e.g. while setting a variable)
the line typed may be edited with the standard
187 188 189 190
erase and kill characters.  A null line in response to a prompt,
or an interrupt, will abort the dialogue and return you to the
remote machine.
.Pp
191
.Nm Ntip
192
guards against multiple users connecting to a remote system
193
by opening terminal lines with exclusive access.
194
.Ss VARIABLES
195
.Nm Ntip
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
maintains a set of
.Ar variables
which control its operation.
Some of these variables are read-only to normal users (root is allowed
to change anything of interest).  Variables may be displayed
and set through the ``s'' escape.  The syntax for variables is patterned
after
.Xr vi  1
and
.Xr Mail  1  .
Supplying ``all''
as an argument to the set command displays all variables readable by
the user.  Alternatively, the user may request display of a particular
variable by attaching a `?' to the end.  For example ``escape?''
displays the current escape character.
.Pp
Variables are numeric, string, character, or boolean values.  Boolean
variables are set merely by specifying their name; they may be reset
by prepending a `!' to the name.  Other variable types are set by
concatenating an `=' and the value.  The entire assignment must not
have any blanks in it.  A single set command may be used to interrogate
as well as set a number of variables.
Variables may be initialized at run time by placing set commands
(without the ``~s'' prefix in a file
.Pa .tiprc
in one's home directory).  The
.Fl v
option causes
224
.Nm ntip
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
to display the sets as they are made.
Certain common variables have abbreviations.
The following is a list of common variables,
their abbreviations, and their default values.
.Bl -tag -width Ar
.It Ar beautify
(bool) Discard unprintable characters when a session is being scripted;
abbreviated
.Ar be  .
.It Ar baudrate
(num) The baud rate at which the connection was established;
abbreviated
.Ar ba  .
.It Ar dialtimeout
(num) When dialing a phone number, the time (in seconds)
to wait for a connection to be established; abbreviated
.Ar dial  .
.It Ar echocheck
(bool) Synchronize with the remote host during file transfer by
waiting for the echo of the last character transmitted; default is
.Ar off  .
.It Ar eofread
(str) The set of characters which signify an end-of-transmission
during a ~< file transfer command; abbreviated
.Ar eofr  .
.It Ar eofwrite
(str) The string sent to indicate end-of-transmission during
a ~> file transfer command; abbreviated
.Ar eofw  .
.It Ar eol
(str) The set of characters which indicate an end-of-line.
256
.Nm Ntip
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
will recognize escape characters only after an end-of-line.
.It Ar escape
(char) The command prefix (escape) character; abbreviated
.Ar es  ;
default value is `~'.
.It Ar exceptions
(str) The set of characters which should not be discarded
due to the beautification switch; abbreviated
.Ar ex  ;
default value is ``\et\en\ef\eb''.
.It Ar force
(char) The character used to force literal data transmission;
abbreviated
.Ar fo  ;
default value is `^P'.
.It Ar framesize
(num) The amount of data (in bytes) to buffer between file system
writes when receiving files; abbreviated
.Ar fr  .
.It Ar host
(str) The name of the host to which you are connected; abbreviated
.Ar ho  .
.It Ar login
(str) Pathname of a login shell script to run once connected; standard input
and output are redirected to the remote host. Leading tildes in the pathname
are expanded expansion; abbreviated
.Ar li  .
.It Ar logout
(str) Pathname of a shell script to run before disconnecting; standard input
and output are redirected to the remote host. Leading tildes in the pathname
are expanded expansion; abbreviated
.Ar lo  .
.It Ar prompt
(char) The character which indicates an end-of-line on the remote
host; abbreviated
.Ar pr  ;
default value is `\en'.  This value is used to synchronize during
data transfers.  The count of lines transferred during a file transfer
command is based on receipt of this character.
.It Ar raise
(bool) Upper case mapping mode; abbreviated
.Ar ra  ;
default value is
.Ar off  .
When this mode is enabled, all lower case letters will be mapped to
upper case by
303
.Nm ntip
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
for transmission to the remote machine.
.It Ar raisechar
(char) The input character used to toggle upper case mapping mode;
abbreviated
.Ar rc  ;
default value is `^A'.
.It Ar record
(str) The name of the file in which a session script is recorded;
abbreviated
.Ar rec  ;
default value is ``tip.record''.
.It Ar script
(bool) Session scripting mode; abbreviated
.Ar sc  ;
default is
.Ar off  .
When
.Ar script
is
.Li true  ,
324
.Nm ntip
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
will record everything transmitted by the remote machine in
the script record file specified in
.Ar record  .
If the
.Ar beautify
switch is on, only printable
.Tn ASCII
characters will be included in
the script file (those characters between 040 and 0177).  The
variable
.Ar exceptions
is used to indicate characters which are an exception to the normal
beautification rules.
.It Ar tabexpand
(bool) Expand tabs to spaces during file transfers; abbreviated
.Ar tab  ;
default value is
.Ar false  .
Each tab is expanded to 8 spaces.
.It Ar verbose
(bool) Verbose mode; abbreviated
.Ar verb  ;
default is
.Ar true  .
When verbose mode is enabled,
350
.Nm ntip
351 352 353 354 355
prints messages while dialing, shows the current number
of lines transferred during a file transfer operations,
and more.
.El
.Sh ENVIRONMENT
356
.Nm Ntip
357 358 359 360 361 362 363 364 365 366 367 368
uses the following environment variables:
.Bl -tag -width Fl
.It Ev SHELL
(str) The name of the shell to use for the ~! command; default
value is ``/bin/sh'', or taken from the environment.
.It Ev HOME
(str) The home directory to use for the ~c command; default
value is taken from the environment.
.It Ev HOST
Check for a default host if none specified.
.El
.Pp
369
The variable
370
.Ev ${REMOTE}
371
is also exported.
372
.Sh FILES
373
.Bl -tag -width /etc/remote -compact
374 375 376 377 378 379 380 381 382 383 384 385
.It Pa /etc/remote
Global system descriptions.
.It ${REMOTE}
Private system descriptions.
.It ~/.tiprc
Initialization file.
.It Pa tip.record
Record file.
.El
.Sh DIAGNOSTICS
Diagnostics are, hopefully, self explanatory.
.Sh SEE ALSO
386
.Xr tip 1 ,
387 388 389 390
.Xr remote 5
.Sh HISTORY
The
.Nm tip
391
command appeared command in
392
.Bx 4.2 .
393 394 395
The
.Nm ntip
command was an act of desperation on the part of its author.
396 397 398
.Sh BUGS
The full set of variables is undocumented and should, probably, be
pared down.
399 400
.Nm Tip
and all of its bastard spawn should be eliminated from the face of the earth.