When we download bash scripts that have been written by others in our daily work, sometimes some key strings are marked with special colors. How can this effect be achieved by writing in a script?
We can write a script to observe the color change.
#!/bin/bash# Font color cycleforcolor1in{31..37}doecho-e"\033[0;${color1};40m---hello! world---\033[0m"doneecho"-------"# Background color cycleforcolor2in{40..47}doecho-e"\033[30;${color2}m---hello! world---\033[0m"doneecho"-------"# Cycle of display modeforcolor3in014578doecho-e"\033[${color3};37;40m---hello! world---\033[0m"done