Make echo colorful with easier method. In bash, sh, fish, ksh and zsh.
Please note that certain colors will really depond on the environment, my demo is under a terminal called Terminator, you can simply install it via apt, yum, pkg or other package manager. Actually, all the colors display depend on the environment setting, but I just name/define name by the most common cases I know by far.
MENU
Installation
Usage
Examples
Supported shells
Supported styles
Supported colors
Notes
Screenshot
Demo
Author
- Download the script, choice the one for your shell by its extension in the filename.
- For example dist/ColorEcho.bash for bash.
- Add a line to include the script in your shell rc or run it directly:
. ./ColorEcho.bash
- echo.
StyleColor
(if you are usingksh
/sh
, there is no.
dot symbol)
- echo.Cyan
- echo.ULCyan
- echo.LightCyan
- echo.BoldCyan
- echo.BoldULCyan
- Bourne shell (sh)
- Bourne-Again shell (bash)
- Z shell (Zsh)
- Korn shell (ksh)
- Friendly interactive shell (fish)
- Bold as
Bold
- Light as
Light
- Underline as
UL
- See color table
- If you have lolcat, you can also try
echo.Rainbow
. - If you are using Mac OS, please upgrade your bash first, you can use Homebrew or MacPorts, the origin bash is too old.
ksh
/sh
shell's color echo may rely on external/bin/echo
, it may not work properly with color under BSD and Mac OS.
GPL-2.0 (GNU GENERAL PUBLIC LICENSE Version 2)