Tool -flag considered harmful (was: grep replacement)

Guy Harris guy at gorodish.Sun.COM
Fri Jun 17 03:37:04 AEST 1988


> While we're on the subject of efficiency, cmp is coded wrong. It should
> first stat the two files to be compared. If the character count is different,
> so are the files. And files tend to be different more often than the same.

This helps out "cmp -s", but doesn't help the others, of course.

> Cmp also takes (BSD cmp at least) third and fourth numeric arguments;
> the offsets within the file to start comparing at.

They all do - or, at least, the 4BSD and S5"R1" ones do, which makes it likely
that the V7 one did (I don't have the source handy to check).



More information about the Comp.unix.wizards mailing list