utility adds extra characters (
, and so on)
to the beginning of lines.
That can cause you real grief with tabstops because the extra characters
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.
If you use
though, piping diff
's output through
or pr -e
diff afile bfile | expand -4
doesn't help because diff
has already added the extra characters.
The best answers I've seen are the
process substitution operator and the
(exclamation point) script . (9.18
You can expand TABs before diff
For example, to show the differences between two files with 4-column
diff <(expand -4 afile) <(expand -4 bfile)
diff `! expand -4 afile` `! expand -4 bfile`