Skip to content

Instantly share code, notes, and snippets.

@Sy3Omda
Forked from mvndaai/echo_with_colors.sh
Created January 30, 2021 10:42
Show Gist options
  • Save Sy3Omda/e48dcc1872403a849abdf31df3d42ca5 to your computer and use it in GitHub Desktop.
Save Sy3Omda/e48dcc1872403a849abdf31df3d42ca5 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