[BACK]Return to .etsh.logout CVS log [TXT][DIR] Up to [cvs] / v6shell / examples

File: [cvs] / v6shell / examples / .etsh.logout (download)

Revision 1.4, Sat Dec 15 21:22:04 2018 UTC (4 weeks, 4 days ago) by jneitzel
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines

Update examples/{.*,*}; primarily, 'io' to 'nl' changes...; + in
examples/.etshrc, remove the fd2(1) rdirection to /dev/null from
the V & VV aliases

: $h/.@EBN@.logout - " Modify to taste. "
:
: "  The author of this file, J.A. Neitzel <jan (at) etsh (dot) nl>,  "
: "  hereby grants it to the public domain.                           "
:
: "  From:  https://etsh.nl/examples  "
:

trap : 2 3

: fd2 -e echo "debug: Executing `"$h/.@EBN@.logout"' now..."

:
: " Check for ETSHDIR ($d), and remove it before logout. "
:
: EtshDir
if -z "$d" -o ! -d "$d" goto Logout

	chdir ; rm -rf "$d" ; chdir -
	: fallthrough

: Logout - " Log out or start new login shell according to user response. "

	chdir ; fd2 -e echo
	fd2 -e echo -n 'Do you want to log out now? ([y]/n) '
	head -1 <- | tr -d ' \t' > .etsh-logout-$$

	if ! -s .etsh-logout-$$ -o \
		{ egrep '^$|^[Yy][A-Za-z]*$' .etsh-logout-$$ >/dev/null } \
			if { rm -f .etsh-logout-$$ } exit
	if ! { which @EBN@ >/dev/null } \
		if { rm -f .etsh-logout-$$ } if { exit } sleep 5

	rm -f .etsh-logout-$$ ; unsetenv TTY ; chdir -
	clear <- ; trap - 2 3 ; exec @EBN@ -l <-