Re: I would like to make a suggestion for the diff command.

Bob Proulx <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
Jeff Silverman wrote:
> I have a command which comes in two variants.  The command outputs a single
> line that is a couple of thousand characters long.  The diff command
> correctly outputs that the two lines are different, but I would like to
> know which characters within the line are different.

Check out the wdiff program.  It will do what you want.

  https://www.gnu.org/software/wdiff/

  bash$ wdiff <(echo one two three) <(echo one too three)
  one [-two-] {+too+} three

Also see the -t option for terminal highlighting.

Also note that the diffutils have a dedicated mailing list.  You can
reach the diffutils developers directly at the [email protected]
address.  Here is the web page with more information.

  https://www.gnu.org/software/diffutils/

> I would like you to add a --color switch to make diff output the characters
> that are different in different colors, say red for deletions and green for
> additions.  The diff command would have to sense the terminal type to see
> if it is color capable.

Also check out the "colordiff" program.

  http://www.colordiff.org/

Bob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.