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, STDERR
  • info β†’ purple, STDOUT
  • normal β†’ no color, STDOUT
  • result β†’ green, STDOUT
  • warn β†’ 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", ccecho will act as plain echo -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