[comp.unix.questions] Logout from inside Suntools

moss@BRL.MIL (VLD/VMB) (11/22/88)

This works well for me in my .profile:

case $TERM in
sun)	case "`tty`" in
	/dev/console)	wait
			echo "suntools ? \c"
			read answer junk
			case $answer in
			[nN]*)	;;
			*)	/usr/bin/suntools;
				exec ${SHELL} $HOME/.logout;;
			esac;;
	esac;;
esac


If you want suntools, hit <return> to the "suntools ? " prompt, otherwise
a 'n' or 'N' will allow you to avoid it (I don't like typing interrupts at my
.profile, but that way works fine too).  The key is the  'exec' of .logout
which replaces your login shell, logging you out.

-moss