Challenge - 5 Problems
ANSI Color Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output color of this script?
This bash script prints the word Success in a specific color. What color will the text appear as in the terminal?
Bash Scripting
echo -e "\e[32mSuccess\e[0m"Attempts:
2 left
💡 Hint
Look up the ANSI color code 32.
✗ Incorrect
The ANSI escape code \e[32m sets the text color to green. The \e[0m resets the color back to default.
💻 Command Output
intermediate1:30remaining
What will this script output?
This script prints two words with different colors. What will be the color of the word Error?
Bash Scripting
echo -e "\e[33mWarning\e[0m and \e[31mError\e[0m"Attempts:
2 left
💡 Hint
Check the ANSI codes 33 and 31.
✗ Incorrect
Code 33 sets yellow color, 31 sets red. So 'Warning' is yellow and 'Error' is red.
📝 Syntax
advanced2:00remaining
Which option correctly prints Done in bold blue?
Choose the correct bash command that prints the word Done in bold blue text.
Attempts:
2 left
💡 Hint
The order of codes in the escape sequence matters.
✗ Incorrect
The correct format is \e[1;34m where 1 is bold and 34 is blue. Other orders or separate codes may not work as expected.
🔧 Debug
advanced2:00remaining
Why does this script not color the output?
This script is intended to print Alert in red, but the output is plain text. What is the problem?
Bash Scripting
echo "\e[31mAlert\e[0m"Attempts:
2 left
💡 Hint
Try running the command with -e option.
✗ Incorrect
Without -e, echo prints the escape codes as plain text. Adding -e enables interpretation of escape sequences.
🚀 Application
expert2:30remaining
How to print a blinking yellow warning message?
You want to print the word Warning in blinking yellow text using ANSI escape codes in bash. Which command achieves this?
Attempts:
2 left
💡 Hint
Blinking code is 5, yellow is 33; order matters.
✗ Incorrect
The code \e[5;33m sets blinking (5) and yellow (33) together. Other orders or separate codes may not work consistently.