logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

ccecho - ccecho (conditional color echo) lets you use colored output for STDOUT while using regular

Author

FrankSundermeyer <fsundermeyer@opensuse.org>
           Developer

1.0                                                08/23/2023                                          CCECHO(1)

Description

       Prints a colored message string to STDOUT or STDERR using bash color codes. The color and the output
       channel depend on 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).

Environment

COLOR
           When set to "0" or "no", ccecho will act as plain echo -e doing no colored output.

Name

       ccecho - ccecho (conditional color echo) lets you use colored output for STDOUT while using regular
       output for log files, pipes and scripts

Parameters

       ccecho 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, STDERR
           info    ->  purple, STDOUT
           normal  ->  no color, STDOUT
           result  ->  green, STDOUT
           warn    ->  red, STDERR

   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.

See Also

echo(1)

Synopsis

ccecho LEVEL MESSAGE

See Also