Last active
January 30, 2024 07:15
-
-
Save bupy7/8de1b2134ec63a19ee441a25a24102d4 to your computer and use it in GitHub Desktop.
Bash/Shell coloring
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
#!/usr/bin/env bash | |
BOLD="$(tput bold)" | |
UNDERLINE="$(tput smul)" | |
STANDOUT="$(tput smso)" | |
NONE="$(tput sgr0)" | |
BLACK="$(tput setaf 0)" | |
RED="$(tput setaf 1)" | |
GREEN="$(tput setaf 2)" | |
YELLOW="$(tput setaf 3)" | |
BLUE="$(tput setaf 4)" | |
PURPLE="$(tput setaf 5)" | |
CYAN="$(tput setaf 6)" | |
WHITE="$(tput setaf 7)" | |
print() { | |
if [ $# -gt 1 ]; then | |
echo $2$1$NONE | |
tput sgr0 | |
else | |
echo $1 | |
fi | |
} | |
print "Mazafaka" $PURPLE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment