home *** CD-ROM | disk | FTP | other *** search
Korn shell script | 1997-02-07 | 919 b | 48 lines |
- #!/bin/ksh
- #
- # Simple script to fire up a shell window
- #
-
- Usage="$0 <origin> <display> [<host>]"
-
- #
- # Make sure enough args were specified
- #
- if [ $# -lt 2 -o $# -gt 3 ]; then
- echo "Incorrect number of arguments to $0"
- echo $Usage
- exit 1
- fi
-
- #
- # Give the arguments more meaningful names
- #
- Origin=$1
- Display=$2
- if [ $# -eq 3 ]; then
- Host=$3
- else
- Host=$Origin
- fi
-
- #
- # If this command is running on the origin machine (implied by Display
- # being ":0[.0]") but the winterm itself will be running on another machine,
- # the Display variable must be set as if we are a remote machine.
- #
- if [ "$Display" = ":0" -o "$Display" = ":0.0" ]; then
- if [ X$Origin != X$Host ]; then
- Display=`hostname`"."`domainname`":0"
- fi
- fi
-
- #
- # Invoke winterm on the appropriate machine
- #
- if [ X$Host = X$Origin ]; then
- exec /usr/sbin/winterm -display $Display
- else
- exec /usr/sbin/arshell $Host /usr/sbin/winterm -display $Display
- fi
-
-