Colour Errors / Warnings / Information in bash script
1
vote
1
answer
5201
views
So I have the following variables defined in
echo -e "$FRED Red" *at the prompt*, I actually get
/etc/bash.bashrc
:
RS="\033
Red
in red on gnome-terminal, but when I execute:
#!/bin/bash
echo -e "$FRED Red"
echo -e "$FYEL Yellow"
echo -e "$FGRN Green"
I get everything in the default colour even though $TERM
is xterm-256color
.
[screenshot including exact output" class="img-fluid rounded" style="max-width: 100%; height: auto; margin: 10px 0;" loading="lazy">
*What am I doing wrong?*
**Note:** Eventually I want to echo Errors in red, Warnings in yellow and Info in green in my scripts.
Asked by Fabby
(5549 rep)
Nov 17, 2018, 12:13 PM
Last activity: Nov 17, 2018, 01:37 PM
Last activity: Nov 17, 2018, 01:37 PM