CCECHO(1) Conditional Color Echo CCECHO(1)NAMEccecho - ccecho (conditional color echo) let's you use colored output
for STDOUT while using regular output for log files, pipes and scripts
SYNOPSISccecho LEVEL MESSAGE
DESCRIPTION
Prints a colored message string to STDOUT using bash color codes. The
color depends on one of the LEVEL keyword. When the SHELL environment
variable COLOR is set to either "0" or "no" no color output is
generated.
The main purpose of this script is to provide an easy method to
generate colored output when the output should go to STDOUT, and
regular output (using echo -e) for log files, pipes and scripts (by
exporting COLOR=0).
PARAMETERSccecho takes two parameters, both are mandatory:
LEVEL
Determines which color is used. Must be used as the first parameter. Is
ignored, when the ebvironment variable COLOR is set to "0" or "no".
error -> bold red
info -> purple
normal -> no color
result -> green
warn -> red
MESSAGE
The message to be printed. Needs to be quoted using double quotes. You
may use sequences supported by echo (1) such as \n to insert a newline
and \t to insert a tab.
ENVIRONMENT
COLOR
When set to "0" or "no", ccecho will act as plain echo -e doing no
colored output.
SEE ALSOecho(1)AUTHOR
Frank Sundermeyer <fsundermeyer@opensuse.org>
Developer
1.0 09/28/2013 CCECHO(1)