4 usage
="Usage: $0 [-l username] [-k] [-fF] [-t args_to_telnet] [-x args_to_xterm] [-K args_to_kx] [-w term_emulator] [-b telnet_binary] [-n] [-v] [-h | --help] [--version] host [port]"
11 -l) telnet_args
="${telnet_args} -l $2 "; kx_args="${kx_args} -l $2"; title="${2}@"; shift 2;;
12 -t) telnet_args
="${telnet_args} $2 "; shift 2;;
13 -x) xterm_args
="${xterm_args} $2 "; shift 2;;
14 -f) telnet_args
="${telnet_args} -f"; shift;;
15 -F) telnet_args
="${telnet_args} -F"; shift;;
16 -k) kx_args
="${kx_args} -k"; shift;;
17 -K) kx_args
="${kx_args} $2 "; shift 2;;
18 -n) term
=none
; shift;;
19 -w) term
=$2; shift 2;;
20 -b) binary
=$2; shift 2;;
21 --version) echo "$0: %PACKAGE% %VERSION%"; exit 0;;
22 -h) echo $usage; exit 0;;
23 --help) echo $usage; exit 0;;
24 -v) set -x; verb
=1; shift;;
25 -*) echo "$0: Bad option $1"; echo $usage; exit 1;;
29 if test $# -lt 1; then
35 title
="${title}${host}"
37 pdc_trams
=`dirname $0`
38 PATH
=$pdc_trams:$bindir:$PATH
40 set -- `kx $kx_args $host`
41 if test $# -ne 3; then
42 echo "Warning: Cound not setup X forwarding"
47 screen
=`echo $DISPLAY | sed -ne 's/[^:]*:[0-9]*\(\.[0-9]*\)/\1/p'`
56 if test -z "$term"; then
57 for j
in xterm dtterm aixterm dxterm hpterm
; do
60 if test -x $i/$j; then
66 test "$verb" && echo "Telnet command used is `type $binary`."
67 if test -n "$term" -a "$term" != "none"; then
68 ($term -title $title -n $title $xterm_args -e env DISPLAY
=$disp XAUTHORITY
=$auth $binary -D $telnet_args $host $port; test x
"$pid" != xNO
&& kill -USR2 $pid) &
70 env DISPLAY
=$disp XAUTHORITY
=$auth $binary -D $telnet_args $host $port
71 test x
"$pid" != xNO
&& kill -USR2 $pid