4

I am using the command(diff) on macOS. The document says:

-s --report-identical-files
             Causes diff to report files which are the same, which are
             otherwise not mentioned.

However, the command always says "files are identical" with -s option.

% echo "aaa" > a.txt
% echo "bbb" > b.txt
% diff -s a.txt b.txt 
1c1
< aaa
---
> bbb
Files a.txt and b.txt are identical

Isn't it weird..?

2
  • 3
    I don't get your result using diff (GNU diffutils) 3.10, but can using the default Apple diff (based on FreeBSD diff), so probably a bug. Commented Jun 27, 2023 at 1:53
  • 1
    indeed I have both diffs on my mac and got the issue with /usr/bin/diff which is Apple diff (based on FreeBSD diff) Commented Jun 27, 2023 at 2:03

1 Answer 1

4

This appears to be a bug in the implementation of diff on macOS Sonoma not present in macOS Big Sur. The issue must have appeared in one of the intermediate Monterey or Ventura releases.

Someone says they noticed the issue in an earlier release of Sonoma and that they reported the issue to Apple, but they (and I) can confirm that the bug still exists in macOS Sonoma 14.2.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.