Skip to content

Instantly share code, notes, and snippets.

@z-------------
Created December 2, 2014 00:42
Show Gist options
  • Save z-------------/bc3ed5561aa90f657928 to your computer and use it in GitHub Desktop.
Save z-------------/bc3ed5561aa90f657928 to your computer and use it in GitHub Desktop.
Change colors in terminal
#!/bin/bash
black="\033[0;30m"
blue="\033[0;34m"
green="\033[0;32m"
cyan="\033[0;36m"
purple="\033[0;35m"
orange="\033[0;33m"
lightgrey="\033[0;37m"
darkgrey="\033[1;30m"
lightblue="\033[1;34m"
lightgreen="\033[1;32m"
lightcyan="\033[1;36m"
lightred="\033[1;31m"
lightpurple="\033[1;35m"
yellow="\033[1;33m"
white="\033[1;37m"
red="\033[0;31m"
none="\033[0m"
string=$1
colorstring="${string}"
printf "${!colorstring}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment