Documented -v flag for Versatec (jaap).
[unix-history] / usr / src / local / local.cmd / difftc.sh
CommitLineData
6630b441
KL
1#! /bin/csh -f
2#
e4a5fa9a 3# SCCS id: @(#)difftc.sh 1.3 (Berkeley) %G%
6630b441
KL
4#
5# diff termcap files
977b5828 6set n=1 files=() term=()
6630b441
KL
7
8while ($n <= $#argv)
977b5828 9 if ("$argv[$n]" == "-f") then
6630b441 10 @ n++
6630b441
KL
11 if ($argv[$n] !~ /*) then
12 set files=($files $cwd/$argv[$n])
13 else
14 set files=($files $argv[$n])
15 endif
977b5828
KL
16 else
17 set term=($term $argv[$n])
6630b441
KL
18 endif
19 @ n++
20end
977b5828 21
6630b441 22switch ($#files)
977b5828 23case 0:
e4a5fa9a
KL
24 set files=(/etc/termcap)
25case 1:
977b5828 26 if ($#term != 2) then
e4a5fa9a 27 echo need two entries to diff
6630b441 28 exit 1
977b5828
KL
29 endif
30 breaksw
977b5828 31case 2:
977b5828
KL
32 breaksw
33default:
34 echo too many termcap files
35 exit 1
6630b441
KL
36endsw
37
38onintr cleanup
977b5828 39
e4a5fa9a
KL
40if ($#files == 1) then
41 /usr/local/showtc -s -f $files $term[1] > /tmp/tcd$$.old
42 /usr/local/showtc -s -f $files $term[2] | diff /tmp/tcd$$.old -
977b5828
KL
43else
44 /usr/local/showtc -f $files[1] $term > /tmp/tcd$$.old
45 /usr/local/showtc -f $files[2] $term | diff /tmp/tcd$$.old -
46endif
6630b441
KL
47
48cleanup:
49rm -f /tmp/tcd$$.old