shell 使用函数

Color_Text()
{
  echo -e " \e[0;$2m$1\e[0m"
}

Echo_Red()
{
  echo $(Color_Text "$1" "31")
}

Echo_Green()
{
  echo $(Color_Text "$1" "32")
}

Echo_Yellow()
{
  echo $(Color_Text "$1" "33")
}

Echo_Blue()
{
  echo $(Color_Text "$1" "34")
}

Echo_Red 'Success!!!';

优点意思!!!

posted @ 2020-06-10 10:20  TBHacker  阅读(153)  评论(2编辑  收藏  举报