I am sourcing a file with this content
export fgBlack8="$(tput setf 0)";
export fgRed8="$(tput setf 1)";
export fgGreen8="$(tput setf 2)";
export fgYellow8="$(tput setf 3)";
export fgBlue8="$(tput setf 4)";
export fgMagenta8="$(tput setf 5)";
export fgCyan8="$(tput setf 6)";
export fgWhite8="$(tput setf 7)";
export bgBlack8="$(tput setb 0)";
export bgRed8="$(tput setb 1)";
export bgGreen8="$(tput setb 2)";
export bgYellow8="$(tput setb 3)";
export bgBlue8="$(tput setb 4)";
export bgMagenta8="$(tput setb 5)";
export bgCyan8="$(tput setb 6)";
export bgWhite8="$(tput setb 7)";
according to this link: https://linux.101hacks.com/ps1-examples/prompt-color-using-tput/
Then, when testing the Colors with a few commands like this
echo -e "${fgBlack8}fgBlack8"
echo -e "${fgRed8}fgRed8"
echo -e "${fgGreen8}fgGreen8"
echo -e "${fgYellow8}fgYellow8"
echo -e "${fgBlue8}fgBlue8"
echo -e "${fgMagenta8}fgMagenta8"
echo -e "${fgCyan8}fgCyan8"
echo -e "${fgWhite8}fgWhite8"
I receive the following output:
Displaying red as blue, yellow as cyan and vice versa. Are the codes on the website wrong or am I using it wrong and produce correct Color mappings by accident?
setaf/setab
colors and thesetf/setb
colors. See man 5 terminfo for details – Coditerminfo
was the place to go. Good luck with your scripting. – Coditput
doesn't allow color names liketput setaf green
? – Cazzie