Skip to content

Instantly share code, notes, and snippets.

@mvndaai
Created September 27, 2014 02:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mvndaai/034b59746b0172dd3b56 to your computer and use it in GitHub Desktop.
Save mvndaai/034b59746b0172dd3b56 to your computer and use it in GitHub Desktop.
Bash echo with colors
#!/bin/sh
echo-bold(){
echo -e '\e[1m'$1'\e[0m'
}
echo-black(){
#You probably shouldn't use this
echo -e '\e[30m'$1'\e[0m'
}
echo-red(){
echo -e '\e[31m'$1'\e[0m'
}
echo-green(){
echo -e '\e[32m'$1'\e[0m'
}
echo-yellow(){
echo -e '\e[33m'$1'\e[0m'
}
echo-blue(){
echo -e '\e[34m'$1'\e[0m'
}
echo-magenta(){
echo -e '\e[35m'$1'\e[0m'
}
echo-cyan(){
echo -e '\e[36m'$1'\e[0m'
}
echo-white(){
#You probably shouldn't use this
echo -e '\e[37m'$1'\e[0m'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment