GETTYDPROXY(1) BSD Reference Manual GETTYDPROXY(1)NAMEgettydproxy - acquire tty from gettyd
SYNOPSISgettydproxy [-dv] [-o option[=value]] command ...
DESCRIPTION
The gettydproxy utility requests a tty from gettyd(8) and passes the file
descriptor of the open modem to the specified command. The following op-
tions are available:
-d Pass the actual device name (e.g., /dev/tty00) instead of the
path name to the open file descriptor (e.g., /dev/fd/4) to the
command (see below).
-o Pass the specified option (with a value of Ar value ) to gettyd.
See ttys.conf(5) for the list of options used by gettyd.
-v Do not contact gettyd, instead print to standard output the com-
mand that would have been executed after gettyd was contacted.
Any ``%MODEM%'' string will not be replaced since gettyd was not
contacted for a port assignment.
Any occurrence of the special string ``%MODEM%'' is replaced with the
path name to the open file descriptor of the modem (e.g., /dev/fd/4) or
the path name to the device if -d is specified (e.g., /dev/tty00). When
the specified command exits, gettydproxy will also exit which will cause
gettyd to revoke the line and make it available for use by other pro-
grams.
This utility is provided to allow programs which do not know how to talk
to gettyd to take advantage of the functionality provided by gettyd.
EXAMPLE
The following is an example script. It assumes that there is a program
called /usr/local/bin/kermit which expects the name of the device to use
to be specified with the -l option and the baud rate to be specified with
the -b option. It processes its arguments and then executes gettydproxy
with the appropriate arguments.
#!/bin/sh
CMD="/usr/local/bin/kermit -l %MODEM%"
OPTS=
while [ $# -gt 0 ] ; do
case $1 in
-l)
OPTS="$OPTS -o line=$2"
shift 2
;;
-b)
OPTS="$OPTS -o dte=$2"
CMD="$CMD $1 $2"
shift 2
;;
-*)
CMD="$CMD $1 $2"
shift 2
;;
*)
CMD="$CMD $1"
shift
;;
esac
done
exec gettydproxy-d $OPTS $CMD
The following script supports the seyon(1) program:
#!/bin/sh
CMD="/usr/X11/bin/seyon -modem %MODEM%"
OPTS=
while [ $# -gt 0 ] ; do
case $1 in
-modem)
OPTS="$OPTS -o line=$2"
shift 2
;;
--)
CMD="$CMD $*"
shift $#
;;
-*)
CMD="$CMD $1 $2"
shift 2
;;
*)
CMD="$CMD $1"
shift
;;
esac
done
exec gettydproxy-d $OPTS $CMD
BUGS
Earlier versions of gettydproxy mistakenly recognized only ``%MODEM'' in-
stead of ``%MODEM%.'' All scripts should use ``%MODEM%,'' however, for
compatibility with scripts written for earlier releases of gettydproxy
``%MODEM'' is still recognized, but strongly discouraged.
SEE ALSOttys.conf(5), gettyd(8)
October 11, 1996 2