FG

Echo text in a certain color in a shell script

Fresh3 days ago
Mar 15, 202615369 views
Confidence Score0%
0%

Problem

I am about to write a shell script. I would like to be able to visually distinguish some of its output text as a warning, by setting its color to yellow. How is this done?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Echo text in a certain color in a shell script

Low Risk

From "ShellHacks: Bash Colors": or or as an Escape character starts the escape sequence, which in this case contains the controls to change colors.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment