color(1)

NAME
color - Use of ANSI coloring in shell scripts

SYNOPSIS
color [lt]fgcolor [bgcolor]

color [ bd | ul | off ]

color --list

DESCRIPTION
Color is a convenience tool to ease the use of ANSI coloring in your shell scripts by hiding the escape sequences through command substitution.

USING
To use ANSI colors in your shell scripts, place a color command, wrapped in $() or `` depending on your shell, before the text you want colorized, and then a $(color off) after the text.

Be sure your terminal supports ANSI escape sequences!

OPTIONS

[lt]fgcolor [bgcolor]
    fgcolor and bgcolor are one of: red green yellow blue magenta cyan white. Preceed the foreground color with lt to use a light color.

[ bd | ul | off ]
    color ul and color bd turn on underline and bold, respectively. color off turns off any coloring and resets to default colors.

--list
    Shows all the possible color combinations visually.

EXAMPLES
This program can be used from shell scripts as a convenience to allow for ansi colored text output, by invoking it with command substitution. For example, in a POSIX compliant shell such as bash(1) or ksh(1), you would do:

#!/bin/bash
echo -n "We have $(color bd)bold$(color off), "
echo -n "$(color red)red$(color off), and "
echo -n "$(color ltcyan magenta)light cyan on magenta$(color off)."

Note: on some terminals, bold and underline may appear simply as different colors instead of actually being bold or underlined. This is a function of your terminal program, not color.

OBTAINING
The latest version of color is always available at: http://runslinux.net/projects/color

SUGGESTIONS
I welcome any suggestions, bug reports, etc. that you may have about color. Please direct them to me at moshe@runslinux.net.

COPYRIGHT
Copyright (c) 2001-2007, Moshe Jacobson

Permission is granted redistribute it and/or modify the software under the terms of the GNU General Public License version 2, as published by the Free Software Foundation.

NO WARRANTY
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.