优秀的DEMO cat /etc/init.d/functions -->里面有颜色定义cat /etc/rc.d/rc.sysinit cat /etc/init.d/nfscat /etc/init.d/portmap cat /etc/init.d/httpd 0. function文件 # -*-Shell-script-*- # # functions This file contains functions to be used by most or all # shell sc…
0. 查看帮助(比如内置功能) man bash -->变量处理大全 1.-计算变量长度的不同方法及不同方法的耗时对比 尽可能的用内置的命令处理,速度快 time for i in $(seq 1111);do count=${#char};done;2.场景的变量数值计算 0.$(()) let expr bc $[] 1.(())的使用:只需要将特定的算术运算表达式用$(())括起 -->效率高 echo $((1+2*2…
1. vim /etc/init.d/nginx 2. chmod 755 /etc/init.d/nginx 3. service nginx status #!/bin/bash # nginx Startup script for the Nginx HTTP Server # it is v.0.0.2 version. # chkconfig: - 85 15 # description: Nginx is a high-performance web and proxy server…