GNU bug report logs - #16618
How to show the diff command when there is a difference when comparing two files?

Previous Next

Package: diffutils;

Reported by: Peng Yu <pengyu.ut <at> gmail.com>

Date: Sat, 1 Feb 2014 19:28:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 16618-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Peng Yu <pengyu.ut <at> gmail.com>
Cc: 16618-done <at> debbugs.gnu.org
Subject: Re: How to show the diff command when there is a difference when
 comparing two files?
Date: Sat, 29 Mar 2014 22:22:40 -0700
> I'm wondering if I just compare two files, it is
> possible to print the diff command if there is a difference between
> the two files?

Not in diff itself, but it's easy to do from a shell script.  E.g.,

command="diff a b"
$command >output || {
  echo "$command"
  cat output
}




This bug report was last modified 11 years and 57 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.