The command watch -d produces a very interesting diff: it shows the most recent iteration of the command, and highlights (with inverse video) the differences to the previous iteration. This works specially well when lines are added or modified (deleted/moved lines cause spurious diffs to appear). I would like to use this kind of format to show fileB, with differences to fileA highlighted. This kind of comparisson does not seem to be available with the diff command.
Is it possible to reuse the implementation that watch uses, but not for running commands, but for generic files? I would like to do:
watch-diff fileA fileB So that I would see fileB, with changes (as compared to fileA) highlighted.
watch diff file1 file2is not ok for you ?vimdiffis also very useful in case you didn't know about it.cat /path/to/fileA, watch the script and edit-in-place the path, e.g.{ sleep 1; sed -i 's/fileA/fileB/' /path/to/myscript; } & watch -d myscript