April Fools' Day Prank

PROMPT_COMMAND='if [ $RANDOM -le 3200 ]; then printf "\0337\033[%d;%dH\033[4%dm \033[m\0338" $((RANDOM%LINES+1)) $((RANDOM%COLUMNS+1)) $((RANDOM%8)); fi'
Add this to a fiend's .bashrc. PROMPT_COMMAND will run just before a prompt is drawn. RANDOM will be between 0 and 32768; in this case, it'll run about 1/10th of the time. \033 is the escape character. I'll call it \e for short. \e7 -- save cursor position. \e[%d;%dH -- move cursor to absolute position \e[4%dm \e[m -- draw a random color at that point \e8 -- restore position.

By: hotdog003
2010-04-01 06:52:32

What Others Think

Evil, and I like it
kaedenn · 609 weeks and 2 days ago
As written, the test is for less than or equal 32 *thousand* so it runs almost every time. Change it to 3200 for 1/10 of the time.
dennisw · 609 weeks and 1 day ago
Ahhh! Didn't notice that! Thanks, dennisw.
hotdog003 · 609 weeks ago
Are you looking for the online admission essay service? Ivory Researcher may be a good choice because they have all of the skills needed to compose and produce high-quality online editing service. A good essay writing service gives you extra weight to the examples in essay writing. Examples will not only make your essay look informative and good but will also develop an interest in the reader to read it. Examples even make the concept easy to understand. Many students believe in this strategy and even use this technique in exams for scoring good marks.
henry6 · 20 weeks ago
I would like to advise you to visit custom research paper writing service to solve the problem of writing essays and any other written work / I am a student and often turn to them for help, because I save my time and at the same time I have excellent academic results
JimmFrost1 · 18 weeks and 1 day ago
An interesting fiction writing work offers you add weight to stuff related to writing. We had cv writer for them. The examples will not only make your essay informative and good but will also develop the reader’s desire to read. The examples even make the concept easier to understand. Many students believe in this technique and even use this technique in tests for evaluating good marks.
oneenn · 15 weeks and 1 day ago
The best project managers using outsourcing and nearshoring in their startups Let me provide you with data on the persons who are the trump cards in the project board. Jeff Sutherland He is the primary supporter and sponsor of Scrum. Jeff Sutherland supported the Scrum model and perfected it to the ideal that IT organizations now use as a key philosophy to improve programming. James A. Highsmith Jim Highsmith is a renowned American designer, author of many books on improving programming with over 25 years of experience in the information technology industry. He currently works at ThoughtWorks as an executive consultant. Highsmith is an expert in coordinated methodology, and his books are about Leadership Agility. End Reassessment and offshoring are unusual tools for customizing an organization's business processes. By choosing these ways to get work done, project administrators can help achieve organizational goals. This may be saving money and time to achieve the final result, the desire to find qualified experts outside the organization, or the need to delegate external tasks to outsiders. We can benefit from the experience of new high-profile businesses that, through reappropriation and offshoring, can enable an organization to scale and grow, resulting in increased revenue and recognition. Bio writer Anastasia is an avid essayist and IT fan. She works as a content manager for Mobilunity, a provider of specialized ad groups around the planet. She enthusiastically follows the latest on all aspects of innovation, agile leadership and software hacking, while sharing her experiences online to help emerging tech companies and organizations stay ahead of the curve.
JuinNicholson · 3 weeks and 3 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: