portability for SVR4
[unix-history] / usr / src / usr.sbin / sendmail / cf / sh / makeinfo.sh
#!/bin/sh
#
# Copyright (c) 1983 Eric P. Allman
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
# %sccs.include.redist.sh%
#
# @(#)makeinfo.sh 8.2 (Berkeley) %G%
#
usewhoami=0
usehostname=0
for p in `echo $PATH | sed 's/:/ /g'`
do
if [ "x$p" = "x" ]
then
p="."
fi
if [ -x $p/whoami ]
then
usewhoami=1
if [ $usehostname -ne 0 ]
then
break;
fi
fi
if [ -x $p/hostname ]
then
usehostname=1
if [ $usewhoami -ne 0 ]
then
break;
fi
fi
done
if [ $usewhoami -ne 0 ]
then
user=`whoami`
else
user=$LOGNAME
fi
if [ $usehostname -ne 0 ]
then
host=`hostname`
else
host=`uname -n`
fi
echo '#####' built by $user on `date`
echo '#####' in `pwd` on $host