Path: utzoo!mnetor!uunet!husc6!yale!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.unix.questions Subject: Re: Unix diff(1) algorithm Message-ID: <7068@brl-smoke.ARPA> Date: 13 Jan 88 06:18:11 GMT References: <11229@brl-adm.ARPA> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 15 In article <11229@brl-adm.ARPA> @RELAY.CS.NET,@humus.huji.ac.IL:amoss@batata.bitne (Amos Shapira) writes: >Does any one knows where to find a description of the algorithm >used in Unix diff(1)? It is described in Bell Labs CSTR #41, "An Algorithm for Differential File Comparison" by J. W. Hunt and M. D. McIlroy (June 1976). Unfortunately this seems to be out of print. I think there were some errors in the report, too. I attempted to rewrite "diff" once, and found some minor speed improvements that could be made to the stock UNIX version. The comments in the UNIX version were fairly accurate and complete, and they're probably more useful than the CSTR anyway. I seem to recall a CACM article some time in the past several years that presented a supposedly better diff algorithm, and it may have also discussed the UNIX diff algorithm.