tags:

views:

151

answers:

3

I would like to compare all GNU Unix manuals and and Mac's Unix manuals by sdiff.

I do not know how you go through, for instance, all Mac's Unix manuals and then save them to a file.

The comparison can be done by the following code when the manuals are in two files

sdiff <(file1) <(file2)

Perhaps, there is some index of Unix command names such that we can do the following

sdiff <(man *[in the index]) <(man *[in the index])

How can you compare all GNU Unix manuals with all Unix manuals in Mac?

[edit]

Mac's manuals are at /usr/share/man/man[1-9]/*. I have an encoding problem with them when I try to cat them.

Another problem is to find the location of Coreutils' manuals.

A: 

All man pages exist within the /usr/share/man/*; I'm not sure what you are attempting to accomplish here. Mac runs on BSD, so most applications are going to be the same as the ones you would find on the BSD machine. If you still wanted to do it, you would need to grab the manual pages of the same applications in *nix as in Mac as well as the same version (since the man page can change). And yea, I would say that doing a diff /usr/share/man/man[0-9]/* and the expanded tar of all the man pages from the linux box.

Suroot
I have Coreutils in my Mac so I try to compare the manuals in my Mac. @Suroot: The encoding seems to be wrong when I try to see all manuals by cat at /usr/share/man/man[0-9]/*
Masi
+2  A: 

GNU means (G)NU is (N)ot (U)nix. GNU is not based, in any way on UNIX, it could not be due to copyright and licensing issues.

Most GNU documentation was written in texinfo format (which Debian later converted to roff (man) format as users wanted man pages). The documentation is in no way based upon the BSD documentation, everything in GNU was written from scratch.

Trying to diff between the two is like diffing a dictionary against a thesaurus. You will find that they both contain many of the same words, but are entirely different books written by entirely different people.

The documentation in no way adequately explains the differences between GNU and BSD (and by extension MacOS).

Tim Post
+2  A: 

Your goal, to identify the differing parameters for the different BSD vs GNU/Linux versions of the various programs, is going to be somewhat tedious. It's useful to note that there are other variants of all commands as well. There are system V versions and BSD versions and GNU versions, and the Mac uses a mish-mash of all 3. In any event, as a starting point, the files themselves are filled with formatting macros that you have no interest in. Pipe the output of man through 'col -b' to get data you can diff. In terms of generating the list of commands, you could just ls -1 /bin /usr/bin' Then something like this would get you most of the way:

while read command ; do
    man $command | col -b > output1
    man ./path/to/GNU/$command | col -b > output2
    diff  output1 output2  |  grep  '^[ ]*-' > $command.diffs
 done<<EOF
 diff
 grep
 sort
 ...
 ...
 EOF
Leonard