So You Like Color--The Mysterious ^[[ Characters
- « first
- ‹ previous
- 1
- 2
- 3
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- Developer Poll
- Dart: a New Web Programming Experience
- What's the tweeting protocol?
- New Products
- Web Hosting IQ
1 hour 30 min ago - Thanks for taking the time to
3 hours 6 min ago - Linux is good
5 hours 4 min ago - Reply to comment | Linux Journal
5 hours 21 min ago - Web Hosting IQ
5 hours 51 min ago - Web Hosting IQ
5 hours 52 min ago - Web Hosting IQ
5 hours 53 min ago - Reply to comment | Linux Journal
8 hours 53 min ago - play with linux? i think you mean work-around linux
17 hours 19 min ago - Where is Epistle?
17 hours 25 min ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.



Comments
Bypass the need for CTRL-V ESC
If you want to omit the CTRL-V ESC key sequence you can use \033 instead.
So the lines would read echo "\033[0;31;40m In Color"
and echo "\033[0;37;40m"
This makes it easier to type and to have in scripts.
Excellent post
A fantastic post, I'm just about to do some scripts involving interpreting these colour codes from the logs from the screen utility, this page was invaluable.
Keep up the good work :-)
Cool Tutorial, but...
Cool tutorial, but, I noticed that in the two coding examples you #define BLINK as 4, when it's actually supposed to be '5'
It's just a small type-o, but I thought I'd let you know just incase someone (such as myself) tries to learn from one of the examples without first looking to the list that correctly defines BLINK as 5.
Inspired me to write a library
It's been a slow day before exams started, so I went and wrote a C header I've named SimpleColors after reading this article: CVS (tarball). Great information!
This link is broken!
This link is broken!
awesome
OMG, this is awesome. I've been wondering for about three years how to do colors in c(besides using ncurses). I just happened to be bored and decided to checkout lj's website since I have a subscription and really like the mag.
I think the editors are retarded for not putting this stuff in the magazine. I mean, I have to look at a computer monitor 12 hours a day and I'd really rather go home and read this stuff from the print mag.
But anyway, awsome article Pradeep. Thanks!
bugs in code
In your while loop, the second and third
ifstatements are incorrect. It looks like you copied/pasted the first statement and did not change the conditions -- you are comparingattrwhen it should befgand thenbg.RE: bugs in code
Sorry, forgot to mention that is for the "Demo of Colors" program.
Will Linux make computers soo
Will Linux make computers soon?
http://blog.detectivemarketing.com/2005/10/will-linux-make-computers-soo...
LINUX is no brand
and never will be. So Linux as a organization could not exist. And you cannot build real material things over the web, cause your hands doesnt fit into the cables :)
Re:
In USSR was not any commercical company. But this counrty was better than USA.
Communism rulezzz!
Such a thing could be
Such a thing could be written by the person who never lived in both countries nor US nor USSR. It seems the author of the previous comment is a teen who grown up in Ukraine as an independent country and considers that USSR was a communist state... Funny :)
look it up
Actually the Ukraine beeing a part of the USSR is not that long ago! They became independant 1991.
cool article. i finally under
cool article. i finally understood colors... although a msg about that it is not possible to paste the escape sequence into your terminal would be good.
But what about outputting to a file?
Hi, I use escape sequences in my program but then if I redirect the output to a file, I start seeing all these escape characters in there. Is there a way that I can disable this functionality when outputting to a file?
istty
http://www.thinkage.ca/english/gcos/expl/c/lib/istty.html