Apply colors to terminal output...
For anyone looking for a simple way (in my opinion) to color the terminal text in linux
# yeah i know... it's csh... if you need bash the syntax is simply red='<colorcode>'
# i have not experimented with other colors, these have always been enough for me.
setenv RED '\033[0;31m'
setenv BOLDRED '\033[1;31m'
setenv GREEN '\033[0;32m'
setenv BOLDGREEN '\033[1;32m'
setenv ORANGE '\033[0;33m'
setenv YELLOW '\033[1;33m'
setenv BLUE '\033[0;34m'
setenv BOLDBLUE '\033[1;34m'
setenv PURPLE '\033[0;35m'
setenv BOLDPURPLE '\033[1;35m'
setenv CYAN '\033[0;36m'
setenv BOLDCYAN '\033[1;36m'
setenv WHITE '\033[0,37m'
setenv BOLDWHITE '\033[1,37m'
# turn color off, i.e. nocolor
setenv NC '\033[0m'
# example
echo "${RED}This text is in red.${NC} This text is now back to whatever the previous color was."
# change my csh/tcsh prompt, and only the prompt, to cyan color that is `[username@host cwd] : ` with all text afterward the default shell color.
set prompt="${CYAN}[%n@%m %~] : ${NC} "
so with the variable setup described above, they can all be local to a bash script for example and you just need to prepend ${COLOR} and append ${NC} to whatever text in your echo statement, or printf, and so on in you bash, csh script or .c or .f program
spectrum_ls
in your terminal, do you get the colors?