#!/bin/sh
#
#pragma ident	"@(#)i.etcprofile	1.6	01/03/13 SMI"
#
# Copyright (c) 1999,2001 by Sun Microsystems, Inc.
# All rights reserved.
#

PATH="/usr/bin:/usr/sbin:${PATH}" export PATH

while read src dest
do
	if [ ! -f $dest ] ; then
		cp $src $dest
	else
		(
			# Get the SCCS ID from the source.
			grep '^#.*ident.*@(#)profile' $src

			# Remove the SCCS ID from the destination.
			# Solaris/Intel console type now "sun-color".
			# Add -bash to shell case
			SHELLS='-sh | -ksh | -jsh'
			sed -e '/^#.*ident.*@(#)profile/d' \
			    -e "s/^${SHELLS})$/${SHELLS} | -bash)/" \
			    -e 's/TERM=AT386/TERM=sun-color/' \
			    $dest
		) > /tmp/prof.$$
		cp /tmp/prof.$$ $dest
		rm -f /tmp/prof.$$
	fi
done

exit 0
