This month, Ives Aerts submits cmptree , a bash script that compares the contents of two directories and reports if like-named files are different. It also reports a missing file or directory as not existing. SCO Unix has provided shell script dircmp since before System V, and Solaris also provides a version of dircmp . While dircmp executes a find on each directory comparing contents, cmptree elegantly compares the two directories recursively. The simplicity of cmptree eliminates some of the functionality of dircmp .
Soft links report only if they are different.
Bash Versus Korn Shell cmptree is a bash shell script, but removing the function keyword in each function allows Korn shell execution. The code snippet above works in both the bash and Korn shells.