Tag Archives: Bash Script

Add a background color to echo statements in a Bash script

To add a background color to your echo statements in a Bash script, you can use ANSI escape codes for text formatting, just like you did for text color. In this case, you’ll use codes for background colors. Here’s an example of how you can do it: #!/bin/bash # Text colors RED=’\033[0;31m’ GREEN=’\033[0;32m’ YELLOW=’\033[0;33m’ NC=’\033[0m’ … Continue reading Add a background color to echo statements in a Bash script