菜鸟的问题
好记性不如烂笔头~。~

1.vim创建shell脚本:

vim创建shell脚本:
# vim xxx.sh

执行shell脚本:
①# sh xxx.sh
②# chmod +x ./xxx.sh  执行  ./xxx.sh
View Code

2.vim使用技巧:

①.' i' 键:将vim环境变为可插入的模式来编写shell脚本

②.'Esc + yy + p':复制脚本

③.'Esc + : q':退出vim shell

④.'Esc + : q!':强制退出vim

⑤.'Esc + : wq':保存退出

⑥.'Esc + :syntax enable ':shell代码高亮

⑦.'Ctrl + z':临时退出vi,# fg 返回到刚才临时退出的vi

3.打开上一次关闭的shell脚本:# !vim

4.脚本的使用:

①测试脚本:sh -n xxx.sh  无返回值表示测试通过无错误

②追踪脚本运行:sh -x xxx.sh

5.

posted on 2019-03-29 14:19  ArSang-Blog  阅读(1357)  评论(0编辑  收藏  举报