The
diff
(28.1
)
utility adds extra characters (>
, <
, +
, and so on)
to the beginning of lines.
That can cause you real grief with tabstops because the extra characters
diff
adds can shift lines enough to make the indentation look wrong.
The diff -t
option expands TABs to 8-character tabstops and
solves the problem.

The best answers I've seen are the
bash<()
process substitution operator and the!
(exclamation point) script . (9.18
)
You can expand TABs before diff
sees them.
For example, to show the differences between two files with 4-column
tabstops: