-
-
Save Sy3Omda/e48dcc1872403a849abdf31df3d42ca5 to your computer and use it in GitHub Desktop.
Bash echo with colors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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