On 12/25/2013 01:00 PM, Florent Monnier wrote: > 2013/12/24, Pádraig Brady wrote: >> On 12/24/2013 12:25 PM, Florent Monnier wrote: >>> Hello, >>> >>> This patch adds a --color option to the commands md5sum and shaXsum. >>> The goal is to make it easier to visually identify similarities in a >>> list of printed checksums. >>> >>> It takes action only if stdout is a tty. >>> >>> This patch can be applied on the version 8.22 of the coreutils. >>> >> >> Sorry you've lost me. Why would you want this? > > I use it since several months. > It has helped me to read and compare more easily / more quickly checksums. > > I would think that some other people using the *sum utils could try > this --color feature a little, and after a while may say if they found > it of some help or not.
I'm a proponent of using colors as they can help a lot: http://www.pixelbeat.org/docs/terminal_colours/ I see others have used something similar: http://rachelbythebay.com/w/2011/08/11/stripes/ >> If you wanted to compare hashes wouldn't it be better >> to pipe to uniq with something like: md5sum * | uniq --group -w32 > > I just discovered from you this new feature --group from the uniq tool > that appeared in the last 8.22 version. > This is a very nice option and surely useful. > > Now I still prefer to see colors in front of me. > But I should try your solution, to compare, and I may change my mind > after a while. > > >> Also this doesn't strictly need to be within the *sum utils, >> so if not of general use, it might be best done as a separate util >> (which could also sort similarly perhaps)? > > Sorry I don't understand what you mean. > Do you mean that it should be an overlay tool, similar to colordiff? > ( http://www.colordiff.org/ ) What I meant is that the output of the *sum utils has enough info to be independently "colored" by something else. If this was a very often used feature then it might make sense to include within the *sum utils, though I'm not sure here... > If this is what you mean, indeed I've also think at such a solution, > but I just didn't do it because I found it easier to patch md5sum > rather than writting a perl (or equivalent language) script. ... A separate tool could have more options like a larger color palette, different formatting options than just directly coloring the checksum, ... > The colordiff wrapper is written with Perl (5 if I'm not mistaken). > I'm not that confident with Perl, this is not my main scripting > language of choice. But it might be the appropriate language for > writting a similar "colorchecksum" tool. I understand from your > example that such a tool would provide more possibilities by combining > it in multiple situations. > > In your opinions, which programming/scripting language could be > appropriate, beside perl, for writting such a tool? Any general purpose language with good string handling, for example python. cheers, Pádraig.
