CCECHO(1)
π CCECHO(1) β Conditional Color Echo π
okay bestie, so ccecho (that's "conditional color echo," the manual name is right there, iykyk) is the little tool that lets you have colored output when you're on STDOUT, but keeps everything plain and boring-safe when your output is going to log files, pipes and scripts. the range? iconic. the vibe? immaculate. π
β¨ SYNOPSIS β¨
ccecho LEVEL MESSAGE
that's it. two things. no cap. π¦
π DESCRIPTION π
so what it does: it prints a colored message string to STDOUT or STDERR using bash color codes. the color AND the output channel both depend on your LEVEL keyword, so it's giving β¨dual purposeβ¨.
and here's the conditional part, the part that ate: when the SHELL environment variable COLOR is set to either "0" or "no", no color output is generated. periodt.
the whole main character reason this script exists is to give you 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 β which you do by exporting COLOR=0. so your terminal gets the sparkle β¨ and your log file gets the plain truth. best of both worlds fr fr.
πΈ PARAMETERS πΈ
ccecho takes two parameters, and bestie, both are mandatory. no skips, no shortcuts. π
π LEVEL
determines which color is used. it must be used as the first parameter. lowkey it gets ignored when the environment variable COLOR is set to "0" or "no" β in that case it's just vibes, no pigment.
errorβ bold red, STDERRinfoβ purple, STDOUTnormalβ no color, STDOUTresultβ green, STDOUTwarnβ red, STDERR
π¦ MESSAGE
the message to be printed, obviously bestie. it needs to be quoted using double quotes β don't come at it with single quotes, it will not serve. π
you may use sequences supported by echo(1) such as \n to insert a newline and \t to insert a tab. yes, tabs. we love a tab moment. β¨
π ENVIRONMENT π
COLORβ when set to"0"or"no",ccechowill act as plainecho -e, doing no colored output. it's the "stealth mode" switch and it's lowkey kind of everything. π§
π₯ SEE ALSO π₯
echo(1)
(the OG. respect the elders. π)
π AUTHOR π
Frank Sundermeyer <fsundermeyer@opensuse.org>
- Developer
okay that's the whole page, you're basically a ccecho expert now slay π this was version 1.0, dated 11/06/2025 β see you in the group chat, bestie! ππ«Ά
π¦ where this page comes from
- ubuntu resolute: daps 3.3.2+cleaned1-7 Β· GPL-2.0-or-later
- ubuntu stonking: daps 3.3.2+cleaned1-7 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms