
Inspired by an earlier posting of termcap-busting scripts, here are
two of my favorites. One prints a termcap entry, the other verbifies
an entry by looking at /usr/man/man5/termcap.5

$ tcfind sun
Mu|sun|Sun Microsystems Workstation console:\
	:li#34:co#80:cl=^L:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\
	:am:bs:km:mi:ms:pt:\
	:ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:\
	:kd=\E[B:kl=\E[D:ku=\E[A:kr=\E[C:kh=\E[H:\
	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
	:al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\
	:rs=\E[s:

$ tcfind sun | tcverb                   (or printenv TERMCAP | tcverb)
Mu|sun|Sun Microsystems Workstation console:
li#34: Number of lines on screen or page
co#80: Number of columns in a line
cl=^L: Clear screen
cm=\E[%i%d;%dH: Cursor motion
... (etc)
rs=\E[s: Reset string, like \fBis\fR but for \fIreset\fP\|(1)

The scripts follow the cut line - not a shar archive. Tcverb has
two bugs, 1) a grep is started up for each capability (slow...)
2) if a terminal name happens to be the same as a capability, some
redundant information is printed. Tabs in tcverb have
been marked with comment lines (\t) in case they get stripped.

       conor rafferty      The command
 decwrl!glacier!conor          1,$s/^\([^,]*\), *\(.*\)/\2 \1/
conor@su-glacier.arpa      although hard to read, does the job.
                           --- Brian W. Kernighan "Advanced Editing on Unix"
