No empty .Rs/.Re
[netbsd-mini2440.git] / crypto / dist / heimdal / appl / kx / rxterm.in
blob46c9f9d98268842696246d5b585313e6176bf264
1 #!/bin/sh
2 # $Heimdal: rxterm.in 10887 2002-03-18 17:37:34Z joda $
3 # $NetBSD$
5 usage="Usage: $0 [-l username] [-k] [-f] [-r rsh_args] [-x xterm_args] [-K kx_args] [-w term_emulator] [-b rsh_binary][-v] [-h | --help] [--version] host"
6 binary=rsh
7 term=xterm
8 while true
9 do
10 case $1 in
11 -l) rsh_args="${rsh_args} -l $2 "; kx_args="${kx_args} -l $2"; title="${2}@"; shift 2;;
12 -r) rsh_args="${rsh_args} $2 "; shift 2;;
13 -x) xterm_args="${xterm_args} $2 "; shift 2;;
14 -f) rsh_args="${rsh_args} -f"; shift;;
15 -k) kx_args="${kx_args} -k"; shift;;
16 -K) kx_args="${kx_args} $2 "; shift 2;;
17 -w) term=$2; shift 2;;
18 -b) binary=$2; shift 2;;
19 --version) echo "$0: %PACKAGE% %VERSION%"; exit 0;;
20 -h) echo $usage; exit 0;;
21 --help) echo $usage; exit 0;;
22 -v) set -x; shift;;
23 -*) echo "$0: Bad option $1"; echo $usage; exit 1;;
24 *) break;;
25 esac
26 done
27 if test $# -lt 1; then
28 echo "Usage: $0 host [arguments to $term]"
29 exit 1
31 host=$1
32 title="${title}${host}"
33 bindir=%bindir%
34 pdc_trams=`dirname $0`
35 PATH=$pdc_trams:$bindir:$PATH
36 export PATH
37 set -- `kx $kx_args $host`
38 if test $# -ne 3; then
39 exit 1
41 screen=`echo $DISPLAY | sed -ne 's/[^:]*:[0-9]*\(\.[0-9]*\)/\1/p'`
42 pid=$1
43 disp=${2}${screen}
44 auth=$3
45 kill -USR1 $pid
46 $binary -n $rsh_args $host "/bin/sh -c 'DISPLAY=$disp XAUTHORITY=$auth $term -T $title -n $title $xterm_args </dev/null >/dev/null 2>/dev/null &'"