标签:
场景脚本
1.提取系统信息
2.获取操作系统运行状态
3.分析应用状态
4.应用日志分析
第一章vim编辑器设置(etc/vimrc或者是用户家目录下.vimrc)
临时设置
末行模式输入 命令 esc:
永久设置(修改vimrc文件)
可用命令:
syntax off/on 语法高亮
set number/nonumber 开启或关闭行号
set autoindent set cindent 自动缩进设置
设置文件头(在vimrc中设置)
autocmd BufNewFile *.py,*.sh, exec ":call SetTitle()"
let $author_name = "mao"
let $author_email = "dd@163.com"
# 命名的函数首字母必须大写
func SetTitle()
if &filetype == ‘sh‘
call setline(1,"\####################################################")
call append(line("."), "\# File Name:".expand("%"))
call append(line(".")+1, "\# Author:".$author_name)
call append(line(".")+2, "\# Mail:".$author_email)
call append(line(".")+3, "\# Created time: ".strftime("%c"))
call append(line(".")+4, "\# =================================================")
call append(line(".")+5, "\#!/bin/bash")
call append(line(".")+6, "")
else
call setline(1,"\############################################################")
call append(line(".")+1,"\# Author:".$author_name)
call append(line(".")+2,"\# Mail;:".$author_email)
call append(line(".")+3,"\# Created time:".strftime("%c"))
call append(line(".")+4,"\# =================================================")
call append(line(".")+5, "\#!/usr/bin/python")
call append(line(".")+6, "")
endif
autocmd BufNewFile * normal G
endfunc
高亮显示
echo -e 终端颜色+ 显示内容+ 结束后的颜色
echo -e “\e[1;30m]” "hello world" $(tput sgr0)
echo -e "\e[1;24m hello world \e[1;0m" 开始颜色+内容+闭合颜色
shell控制脚本
monitor_man.sh控制脚本
#!/bin/bash
resettem=$(tput sgr0)
declare -A ssharray
i=0
numbers=""
for script_file in `ls -I "monitor_man.sh" ./`
do
echo -e "\e[1;35m" "The Script:" ${i} ‘==>‘${resettem} ${script_file}
numbners=[$i]=${script_file}
numbers="${numbers} | ${i}"
i=$((i+1))
done
while true
do
read -p "please input a number [ ${numbers}]:" execshell
if [[ ! ${execshell} =~ ^[0-9]+ ]];then
exit o
fi
/bin/sh ./${ssharry[$execshell]}
done
system_monitor.sh
check_http_log.sh
check_server.sh
标签:
原文地址:http://www.cnblogs.com/maoxianfei/p/5877419.html