#!/bin/sh - # mkhomes - make homes file # Steve Kinzler, kinzler@cs.indiana.edu, Oct 93 # http://www.cs.indiana.edu/~kinzler/home.html#homedir homes=${HOMES-$HOME/etc/homes} tmp=/tmp/mkh$$ trap "rm -f $tmp; exit 2" 1 2 13 15 cat < $tmp # etc/homes - listing of known home directory locations # http://www.cs.indiana.edu/~kinzler/home.html#homedir EOF hosts home | eachhost -V -n -d 30 exec echo \$HOME | sed -n 's,^\([^ :]*:\) \(/[^ ]*\)$,\1\2,p' >> $tmp if cmp $tmp "$homes" > /dev/null 2>&1 then rm -f $tmp exit fi if test -s $tmp then trap '' 1 2 13 15 rm -f "$homes" cat $tmp > "$homes" status=$? else echo "$0: $homes not created" 1>&2 status=1 fi rm -f $tmp exit $status