You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make echo colorful with easier method. In [bash](https://www.gnu.org/software/bash/), [sh](https://en.wikipedia.org/wiki/Bourne_shell), [fish](http://fishshell.com/), [ksh](http://www.kornshell.com/)and [zsh](http://www.zsh.org/). Which can help you print debug, warning, error message in shell scripts with meaningful colors, and make the output more readable.
6
+
**ColorEchoForShell** brings life to your shell scripts by making text output colorful and meaningful. Whether you're debugging, displaying warnings, or showcasing errors, ColorEchoForShell enhances readability and helps you quickly identify messages in various shell environments.
7
7
8
-
Please note that [certain colors](https://github.com/PeterDaveHello/ColorEchoForShell/blob/master/color%20table.txt#L9-L12) will really depend on the environment, different terminal may have different behavior, terminal multiplexer like tmux could also affect the result, especially those color not coded in range 0~7, might have unexpected result with styling. My demo is under a terminal called [Terminator](http://gnometerminator.blogspot.com/p/introduction.html), 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.
8
+
## Quick Start
9
9
10
-
## MENU
10
+
1. Download the appropriate script for your shell (e.g., bash, sh, fish, ksh, zsh).
11
11
12
-
*[`MENU`](#menu)
13
-
*[`Installation`](#installation)
14
-
*[`Usage`](#usage)
15
-
*[`Examples`](#examples)
16
-
*[`Supported shells`](#supported-shells)
17
-
*[`Supported styles`](#supported-styles)
18
-
*[`Supported colors`](#supported-colors)
19
-
*[`Notes`](#notes)
20
-
*[`Screenshot`](#screenshot)
21
-
*[`Demo`](#demo)
22
-
*[`Author`](#author)
12
+
- For bash, download [dist/ColorEcho.bash](./dist/ColorEcho.bash).
13
+
- For other shells, choose the corresponding file from the [dist directory](./dist).
14
+
15
+
2. Source the script in your shell:
16
+
17
+
```bash
18
+
. ./ColorEcho.bash # For bash
19
+
```
20
+
21
+
Replace `ColorEcho.bash` with the appropriate filename for your shell.
22
+
23
+
3. Try a colorful echo:
24
+
25
+
```bash
26
+
echo.Cyan "Hello, colorful world!"
27
+
```
28
+
29
+
## Features
30
+
31
+
- **Versatile Compatibility**: Works with [bash](https://www.gnu.org/software/bash/), [sh](https://en.wikipedia.org/wiki/Bourne_shell), [fish](http://fishshell.com/), [ksh](http://www.kornshell.com/), and [zsh](http://www.zsh.org/).
32
+
- **Easy to Use**: Simple syntax for applying styles and colors.
33
+
- **Customizable**: Supports various styles including bold, italic, underline, blink, and strikethrough.
34
+
- **Environment-Dependent Colors**: Please note that [certain colors](./color%20table.txt#L9-L12) may vary depending on the terminal and environment settings.
* Download the script, choice the one for your shell by its extension in the filename.
27
-
* For example [dist/ColorEcho.bash](https://cdn.rawgit.com/PeterDaveHello/ColorEchoForShell/v0.0.7/dist/ColorEcho.bash) for bash.
28
-
* Add a line to include the script in your shell rc or run it directly:
53
+
To utilize ColorEchoForShell in your shell scripts, first download the appropriate script for your specific shell from the [dist directory](./dist). Then, include the ColorEchoForShell script at the beginning of your script by sourcing it:
29
54
30
-
`. ./ColorEcho.bash`
55
+
```bash
56
+
source ./ColorEcho.bash
57
+
```
58
+
59
+
Replace `./ColorEcho.bash` with the relative path to the downloaded ColorEchoForShell script.
60
+
61
+
This inclusion will enable all the features of ColorEchoForShell within your script.
31
62
32
63
## Usage
33
64
34
-
*echo.`StyleColor`(if you are using `ksh`/`sh`, there is no `.` dot symbol), you can combine at most two styles together, the order of the style doesn't matter.
65
+
Use the `echo.StyleColor`syntax to print colorful text. In `ksh`/`sh`, omit the `.` dot symbol. You can combine up to two styles, and the order doesn't matter.
35
66
36
67
### Examples
37
68
38
-
* echo.Cyan
39
-
* echo.ICyan
40
-
* echo.ULCyan
41
-
* echo.BLCyan
42
-
* echo.STCyan
43
-
* echo.BoldCyan
44
-
* echo.BoldULCyan
45
-
* echo.ULBoldCyan
69
+
- `echo.Cyan`: Prints text in cyan color.
70
+
- `echo.ICyan`: Prints text in italic cyan.
71
+
- `echo.ULCyan`: Prints text in underline cyan.
72
+
- `echo.BLCyan`: Prints text in blinking cyan.
73
+
- `echo.STCyan`: Prints text with strikethrough in cyan.
74
+
- `echo.BoldCyan`: Prints text in bold cyan.
75
+
- `echo.BoldULCyan`: Prints text in bold underline cyan.
76
+
- `echo.ULBoldCyan`: Prints text in underline bold cyan.
- Refer to the [color table](./color%20table.txt).
97
+
- Use the `Light` keyword for lighter versions of standard colors (coded in range 0~7), e.g., `LightYellow`.
64
98
65
-
* See [color table](https://github.com/PeterDaveHello/ColorEchoForShell/blob/master/color%20table.txt)
99
+
## Additional Features
66
100
67
-
* For the standard color(coded in range 0~7), it'll has a light version of the color, just use the `Light` keyword before the color, for example: `LightYellow`.
101
+
- **Rainbow Output**: If you have [lolcat](https://github.com/busyloop/lolcat), try `echo.Rainbow`.
68
102
69
-
## Notes
103
+
## Community Contribution
70
104
71
-
* If you have [lolcat](https://github.com/busyloop/lolcat), you can also try `echo.Rainbow`.
105
+
We welcome contributions, bug reports, and suggestions. Feel free to open an issue or submit a pull request.
72
106
73
-
## Screenshot
107
+
## Screenshots
74
108
75
109

76
110
@@ -84,4 +118,4 @@ GPL-2.0 (GNU GENERAL PUBLIC LICENSE Version 2)
84
118
85
119
## Author
86
120
87
-
[Peter Dave Hello](https://www.peterdavehello.org/), [@Twitter](https://twitter.com/PeterDaveHello), [@GitHub](https://github.com/PeterDaveHello)
121
+
[Peter Dave Hello](https://www.peterdavehello.org/), [@Twitter](https://twitter.com/PeterDaveHello), [@GitHub](https://github.com/PeterDaveHello), [@GitLab](https://gitlab.com/PeterDaveHello)
0 commit comments