![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell
dev-leavel
运维就像盖房子,地基决定了你是以后的平房还是别墅
展开
-
设置shell脚本自动title
vim ~/.vimrc 在家目录下添加文件 .vimrc set ignorecase set cursorline set autoindent autocmd BufNewFile *.sh exec “:call SetTitle()” func SetTitle() if expand("%:e") == ‘sh’ call setline(1,"#!/bin/bash") call ...翻译 2020-02-08 16:35:29 · 777 阅读 · 0 评论 -
shell脚本特殊变量意义
Shell特殊变量:Shell $0, $#, $*, $@, $?, $$和命令行参数 特殊变量列表 变量 含义 $0 当前脚本的文件名 $n 传递给脚本或函数的参数。n 是一个数字,表示第几个参数。例如,第一个参数是$1,第二个参数是$2。 $# 传递给脚本或函数的参数个数。 $* 传递给脚本或函数的所有参数。 $@ 传递给脚本或函数的所有参数。被双引号(" ")包含时,与 $*转载 2018-12-21 10:59:58 · 388 阅读 · 0 评论 -
postgres自动监控启动脚本
[root@yjsyy-bcrdb-205 opt]# cat pg_restart.sh #!/bin/bash while true do ps aux|grep postgre|grep -v grep >/dev/null if [ $? -ne 0 ];then su - bcrdb -s /bin/sh -c '...原创 2019-09-11 11:23:38 · 337 阅读 · 0 评论