#!/bin/csh
#
#  Remote Login Simulation of "su" in new xterm.  (adapted from xsu)
#
#  SYNOPSIS
#       xl [user [host-machine] ]
#
#  OPTIONS
#       user            specifies the username to login as
#       host-machine    specifies machine to login to (default: current one)

set rlogin_cmd=/usr/ucb/rlogin.ucb

#  Get information

    if ($#argv < 1) then
        echo -n "Enter name of the user:  "
        set suser = $<
    else
        set suser = $1
    endif

    if ($#argv > 1) then
        echo $2
        set host = $2
    else
        set host = `hostname`
    endif
    xhost ${host}

#  Allow rlogin

    access_on

#  Create an Xterm with an Rlogin

    xterm -geometry 80x40+0+0 -n ${suser}@${host} -e ${rlogin_cmd} ${host} -l ${suser} &
