Bash colors

From I Will Fear No Evil
Revision as of 14:57, 25 April 2024 by Chubbard (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Use colors within scripts

for (( i = 30; i < 38; i++ )); do echo -e "\033[0;"$i"m Normal: (0;$i); \033[1;"$i"m Light: (1;$i)"; done

Within the script: Where number is defined from the output above

echo -e "\033[0;${NUMBER}mYOUR STRING YOU WANT IN COLOR"

Reset your color after messing with it: reset color after command changes it

echo -e "\033[0m"