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)

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 · 19 weeks ago
This is actually the kind of information I have been trying to find. Thank you for writing this information. Road Trip Planning
Cameliagobella · 18 weeks and 6 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 · 18 weeks and 5 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 · 16 weeks and 6 days ago
family visa UK .. immigration lawyer dublin
saeed20 · 16 weeks and 2 days ago
You cannot be weak on the path of your dream. Dare to overcome the barriers to find your own way. shell shockers
JoEmily · 15 weeks and 6 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 · 15 weeks and 6 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 · 15 weeks and 6 days ago
Found a lot of useful information, glad to join your community! jiofi local html
malkovich · 13 weeks and 2 days 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 · 9 weeks and 5 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 · 9 weeks and 3 days ago
great content! will recommend this site to my friends
looneyhans · 9 weeks and 2 days 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 · 9 weeks and 1 day 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 · 8 weeks and 5 days ago
essay typer How good it will be if someone will complete your challenging Economics essay on Market Structures? How much cost- effective it will be? Are you wondering where you can find such efficient and reliable essay typer?
eliza · 7 weeks and 6 days ago
The article has outstanding image content. All information in the article is very delicate. I will keep waiting for your posts. tamilrockers proxy
saichinni · 7 weeks and 4 days ago
Thanks a lot for all this and thanks for sharing please visit mine as well. [pii_pn_8a68e8c174733080624b]
saichinni · 6 weeks and 3 days ago
guitar lessons boulder I really enjoyed reading your article. I found this as an informative and interesting post, so I think it is very useful and knowledgeable.
yeoyeo · 6 weeks and 2 days ago
Thanks for sharing this great information. http://www.yycsepticservices.ca/
Breana · 4 weeks and 6 days ago
i liked this so much. great help thanks fencecompanyshreveport.com
looneyhans · 4 weeks and 5 days ago
i love this so much! dentalimplants-coloradosprings.com
Killersmile · 4 weeks and 2 days ago
awesome fence company gresham or
looneyhans · 1 week and 4 days ago
Thanks for sharing,It's useful for me seo services
jojokoko · 1 week and 2 days ago
great job! i l love it! couples counseling
idasanka · 1 day 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: