Uniquely (sort of) color text so you can see changes

function colorify() { n=$(bc <<< "$(echo ${1}|od -An -vtu1 -w100000000|tr -d ' ') % 7"); echo -e "\e[3${n}m${1}\e[0m"; }
Colorify colors input by converting the text to a number and then performing modulo 7 on it. This resulting number is used as the color escape code. This can be used to color the results of commands with complex outputs (like "482279054165371") so if any of the digits change, there's a good chance the color will change too. I say good chance because there's only 7 unique colors here, so assuming you were watching random numbers, there would be a 6/7 chance that the color would change when the number changed. This should really only be used to help quickly identify when things change, but should not be the only thing relied upon to positively assert that an output has not changed.
Sample Output
$ colorify test
test (shows as orange)
$ colorify test2
test2 (shows as purple)

1
By: tyzbit
2020-08-06 15:17:45

What Others Think

The content of your article page is very good, I find the content quite good and helpful to me, thank you for UnlockMyTV
UnlockMyTvApk · 10 weeks and 6 days ago
This is actually the kind of information I have been trying to find. Thank you for writing this information. Road Trip Planning
Cameliagobella · 10 weeks and 5 days ago
Color text is a unique and different way to write code on word. This gives a different look and also helps to distinguish between the two codes. The https://honestessaywriter.com/dissertation-help/ is an online writing service for college students.
Corban8 · 10 weeks and 4 days ago
I always get useful information through this site. I am a computer science and engineering graduate. But still, I am not good at coding. Through your site, I found coding easy. Hemp Oil So I use your help to learn to code well.
MariyaDorothy · 8 weeks and 5 days ago
family visa UK .. immigration lawyer dublin
saeed20 · 8 weeks and 1 day ago
You cannot be weak on the path of your dream. Dare to overcome the barriers to find your own way. shell shockers
JoEmily · 7 weeks and 5 days ago
You shouldn't waste time on registration and communication in the service for easy russians brides flirting if your goal is marriage. This rule is self-explanatory. However, how to choose the one that suits serious intentions in the variety of services? I advise you to read reviews on the Internet - this is usually enough. It is also very important how the service itself positions itself. For example, if its main page contains photos of hot beauties or brutal macho and promises of easy, easy communication, this is not an option for serious acquaintances.
ArdellaPolinski · 7 weeks and 5 days ago
The Get-Unique cmdlet compares each item in a sorted list to the next item, eliminates duplicates, and returns only one instance of each item. Hardwood Floor Refinishing St Louis MO
emilygoutagny · 7 weeks and 5 days ago
Found a lot of useful information, glad to join your community! jiofi local html
malkovich · 5 weeks and 1 day ago
Nice to see this post here. It is one of the best sites, and it provides so many good articles related to the programming languages and some programming codes. I think this post will be useful for programmers. Thanks for sharing the valuable information for us. In car mobile phone signal booster Australia
ryanbabraham · 1 week and 4 days ago
The article has outstanding image content. All information in the article is very delicate. I will keep waiting for your posts. technology + “write for us” + guest post
saichinni · 1 week and 2 days ago
great content! will recommend this site to my friends
looneyhans · 1 week and 1 day ago
Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! W88
KayGasaway · 1 week ago
Thank you for sharing. Thanks to this article I can learn more things. Expand your information and abilities. Now, your right place graphic design dissertation topics UK at reliable price.
arielwilson · 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: