OK alignment display (function call) after start service successful

Source: Internet
Author: User

#屏幕的大小SCREEN = ' stty -f /dev/console size '  2>/dev/null  #默认显示的是横排为25   Vertical row for 80columns=${screen#* }[ -z  $COLUMNS  ] && COLUMNS=80   #当不存在/ Dev/console file, directly set COLUMNS to 80spa_col=$[$COLUMNS -14]  #总长度-the size of the trailing display character (as shown as [  ok  ] or [  FAILED&NBSP] (max.) #颜色的设置和选择RED = ' \033[31m '        #红GREEN = ' \033[32m '       #绿     yellow= ' \033[33m '     #黄BLUE = ' \033[34m '        #蓝NORMAL = ' \033[0m '      #正常 # displays oksuccess () when the service starts successfully ()  {         string=$1        rt_spa=$[$SPA _col-${# string}]        echo -n  "$string"          for I in  ' seq 1  $RT _spa ';d o                 echo -n  " "         done         echo -e  "[ ${green}ok${normal} ]"  # OK font shown as green} #当服务启动失败后显示failurefailure ()  {        string=$1         rt_spa=$[$SPA _col-${#string}]         echo -n  "$string"         for i in   ' seq 1  $RT _spa ';d o                 echo -n  " "         done         echo -e  "[ ${red}failed${normal} ]"  # Failed} shown in red


This article is from the "World Road Line World" blog, please be sure to keep this source http://enochline.blog.51cto.com/9390497/1617709

OK alignment display (function call) after start service successful

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.