Informations, tips and technics.

Give your bash scripts some colors

I am pretty sure that every guy that everyone that manage Linux or Unix systems have to deal with bash to create some scripts.

I am currently create one that retrieve some informations on different NIX platforms, like Suns Solaris and Unix.

The goal of this post is not to explain you how to deal with bash but to add some fun to your bash scripts. Adding colors to a scripts could be cool when you have to display important messages, errors or information. Adding colors to those messages make the user more aware of what’s happening and add some eye candy to you script.

We use the echo command with the -e parameter. Here is a small example :


echo -e $COL_BLUEINFO: $COL_RESETThis is an info message
echo -e $COL_REDAn error has occurred$COL_RESET

ref : http://www.bioinspired.com/users/ajg112/software/bashTips.shtml


Filed under: Bash, , ,

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: