So I have the following variables defined in /etc/bash.bashrc
:
RS="\033[0m" # reset
HC="\033[1m" # hicolor
UL="\033[4m" # underline
INV="\033[7m" # inverse background and foreground
FBLK="\033[30m" # foreground black
FRED="\033[31m" # foreground red
FGRN="\033[32m" # foreground green
FYEL="\033[33m" # foreground yellow
And when I do an echo -e "$FRED Red"
at the prompt, I actually get 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
What am I doing wrong?
Note: Eventually I want to echo Errors in red, Warnings in yellow and Info in green in my scripts.
TERM=xterm
at the top of the script just for testing it out.