How do I use wdiff to show the word differences between two files? Right now, I can show which words are in common between two files and print out the stats. I'd like to color red exactly which words are different.
#! usr/bin/bash
wdiff -si12 exp3.txt out.txt | colordiff
This outputs:
Input an integer greater than or equal to 0 or -1 to quit:
The largest number is 5
Goodbye!
exp3.txt: 6 words 39 100% common 0 0% deleted 0 0% changed
out.txt: 6 words 39 100% common 0 0% inserted 0 0% changed
It prints all the common words. I've done --help to look at the supported wdiff commands but I couldn't find how to highlight differences. Any help is appreciated!
The final example on the wdiff manual page suggests a way to add color to the word diffs: