|
| From: | Paul Eggert |
| Subject: | [bug-diffutils] bug#16618: How to show the diff command when there is a difference when comparing two files? |
| Date: | Sat, 29 Mar 2014 22:22:40 -0700 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
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
}
| [Prev in Thread] | Current Thread | [Next in Thread] |