Article View: comp.windows.x
Article #25541MAKEHOSTS - with xterms!
From: lmjm
Date: Tue, 05 May 1987 21:21
Date: Tue, 05 May 1987 21:21
57 lines
2794 bytes
2794 bytes
Depending on your local setup and the energy of your systems
administrators you can probably run commands on another host on your
local ethernet by just doing:
remotehost "ls ~uucp"
Here is a version of the MAKEHOSTS script that sits in /usr/hosts and
crunches up the /etc/hosts file and generates all the symbolic links
from hostname->/usr/ucb/rsh. I've extended it to also generate a link
for each host:- xhostname->/usr/hosts/host_in_window. A little shell
script that does (effectively)
xterm -n "rlogin:remotehost" -e remotehost ...
Please check it out before installing it!!! It works ok locally but
may cause grief your system if you differ from 4.2 (beats me how - I am
just cautious).
Notes:- A symbolic link to host_in_window may be unnecessary if they
are both on the same disc; It isn't fast; You'll probably want to
change the options given to xterm and maybe even its location (I usr
/usr/new/xterm); I though about an xinit like way of allowing some of
the args to go to the xterm - but I never did anything about it.
Have fun
Lee
(I wonder why my shar just dumped?? Oh well here it is as files.)
MAKEHOSTS
------------------------------------------------------------------------------
#! /bin/sh -x
# Create both the ordinary <machine-name> type commands AND
# x<machine-name> which runs in its own window under X.
cd ${DESTDIR}/usr/hosts
mv MAKEHOSTS .MAKEHOSTS
mv host_in_window .host_in_window
rm -f *
for i in `grep -v '^#' ${DESTDIR}/etc/hosts | awk '{print $2}'`;
do
ln -s /usr/ucb/rsh $i
ln -s /usr/hosts/host_in_window x$i
done
mv .MAKEHOSTS MAKEHOSTS
mv .host_in_window host_in_window
------------------------------------------------------------------------------
host_in_window
------------------------------------------------------------------------------
#! /bin/sh
MC=`basename $0 | sed "s/^x//"`
/usr/new/xterm -n "rlogin:$MC" -e $MC $*
------------------------------------------------------------------------------
--
UKUUCP SUPPORT Lee McLoughlin
"What you once thought was only a nightmare is now a reality!"
Janet: lmjm@uk.ac.ic.doc, lmcl@uk.ac.ukc
DARPA: lmjm@doc.ic.ac.uk (or lmjm%uk.ac.ic.doc@cs.ucl.ac.uk)
Uucp: lmjm@icdoc.UUCP, ukc!icdoc!lmjm
Technical Details
Message-ID:
<8705052221.a004255@ivax.doc.ic.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!doc.ic.ac.UK!lmjmShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!doc.ic.ac.UK!lmjm From: lmjm@doc.ic.ac.UK Newsgroups: comp.windows.x Subject: MAKEHOSTS - with xterms! Message-ID: <8705052221.a004255@ivax.doc.ic.ac.uk> Date: Tue, 5-May-87 17:21:23 EDT Article-I.D.: ivax.8705052221.a004255 Posted: Tue May 5 17:21:23 1987 Date-Received: Sat, 9-May-87 00:35:39 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 57