shell输出加颜色
#cat a.sh#!/bin/shblue=`tput setaf 4`reset=`tput sgr0`echo "${blue}[INFORMATION]${reset}"
#!/bin/shlib_dir=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)LOG_format="/var/log/os_stress.log"LOG_real="/var/log/os_real_stress.log" #local level="$(echo $1 | tr 'a-z' 'A-Z')"mesg(){ local GROUP=$1 local IP=$2 local KEY=$3 local VALUE=$4 local MEASURE=$5 echo -e "\033[32m$(date "+%F %H:%M:%S")\033[0m,$GROUP,$IP,$KEY,$VALUE,$MEASURE" return 0}mesg $1 $2 $3 $4 $5