[net.sources] Fun with tset

earleh@dartvax.UUCP (Earle R. Horton) (04/25/87)

Here's one to make the computer "remember" the last terminal you
were using.  You can override at the prompt from tset.

In your ".logout"

unset noclobber
set | sed -n -e '/term/s/ //' -e '/term/s/term//p' > $HOME/.oldterm
echo See you tomorrow $user.

In your ".login"

set OLDTERM = `cat $HOME/.oldterm`
loop:
set noglob; eval `tset  -s -Q \?$OLDTERM`
	if ($TERM == "unknown") goto loop
set term = $TERM

barry@adelie.Adelie.COM (Barry A. Burke) (04/27/87)

In article <6069@dartvax.UUCP> earleh@dartvax.UUCP (Earle R. Horton) writes:
>Here's one to make the computer "remember" the last terminal you
>were using.  You can override at the prompt from tset.
.
.
.
>unset noclobber
>set | sed -n -e '/term/s/ //' -e '/term/s/term//p' > $HOME/.oldterm

Silly! Why not:

echo $TERM > $HOME/.oldterm

 or

echo $term > $HOME/.oldterm


Methinks a case of someone too addicted to the "Real Hacker's Use {sed, awk,
grep, ... } Guide to Wasting Time" >8*X

-- 
LIVE:	Barry A. Burke, (617) 499-6370
USPS:	Adelie Corporation, 125 CambridgePark Drive Cambridge, MA  02140
UUCP:	barry@adelie.Adelie.COM / ..!{harvard,ll-xn,necntc,mirror}!adelie!barry
ARPA:	barry@adelie.Adelie.COM (via MX) / barry%adelie@harvard.Harvard.EDU