Bash

2024-10-07

1. Add Colors

#!/bin/sh
# colors
blue=$(tput setaf 4)
cyan=$(tput setaf 6)
magenta=$(tput setaf 5)
yellow=$(tput setaf 3)
green=$(tput setaf 2)
red=$(tput setaf 1)
normal=$(tput sgr0)

check() {
    if [ "${?}" = '0' ]; then
        printf "${green}Done${normal}"
        printf '\n'
    else
        printf "${red}Fail${normal}"
        printf '\n'
    fi
}

check