Re: single line diff

Jim Meyering <[email protected]>
Newsgroups gmane.comp.gnu.utils
Message-ID <[email protected]>
"[email protected]" <[email protected]> wrote:
> I have a configuration file that contains a VERY long line.  When I do
> a regular diff on versions of this file, it's very difficult for me to
> tell where the difference is coming from on that single line.  Are
> there any tools out there to tell me what the differences are for a
> long single line?

Filter both inputs through a program like fmt or "recode ../QP"
that can split long long lines into more manageable pieces.

E.g., comparing two 800-byte strings that differ only in the last byte:

  $ diff -u0 \
      <(printf %0800d 0|recode ../QP) \
      <(printf %0800d 1|recode ../QP)
  --- /proc/self/fd/11    2007-02-15 14:29:25.836262565 +0100
  +++ /proc/self/fd/17    2007-02-15 14:29:25.824262839 +0100
  @@ -11 +11 @@
  -00000000000000000000000000000000000000000000000000=
  +00000000000000000000000000000000000000000000000001=
  [Exit 1]
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.