Subject: Linux program "sum"

From: Rodney Rieck <[email-masked]>
Date: Fri, 4 Nov 2011 13:37:34 -0500

Hello,

This is about the Linux program "sum" that computes checksums and number of blocks in a file.  I'm not writing about a program error I've found -- I am writing about how the output from the program is formatted.

If you type in something like this:  sum -r *

and if there are multiple files present in the current directory, you will get output like this for each file it checks:

[check_sum] [number_of_blocks] [file_name]

If though on the command line you change the "*" to a single file name, the output is the same except that it doesn't print/display the "[file_name]", I guess because that seems redundant because the file name is already known and was typed in on the command line.

There are cases though where it would be helpful to have that file name on the output line.  Quite often I write scripts, edited from an "ls" command, to do checksums on individual/uniq file names, and then redirect checksum output to another file.  Actually I have 2 copies of these files, and I'm comparing the checksum of the 2 different versions to see if the files are the same.  So, I redirect the checksum output of both instances to a file, and then compare or do "diff" on those 2 checksum output files.  And that of course tells me if there are any differences in the 2 sets of files.

The only problem is that the file name is truncated on the lines where there are differences, so it is then hard to go back and get the actual file names of the differences.

The file name gets truncated on the display also even if there is a wildcard in the file spec keyed on the command line, but "sum" finds only 1 file as a match.

Just to let you know, on SCO Unix (and I suppose other flavors of Unix), the output of a "sum -r [file_name]" with a singular file does print that file name.

Thanks for your consideration,

Rodney Rieck