shell编程,对bash脚本进行语法检测
来源:原创
时间:2017-12-27
作者:脚本小站
分类:SHELL
使用bash命令可以对bash脚本进行语法检测。
bash
-n 对语法进行检测
-x 显示运行过程
例:
bash -n demo.sh 检查语法
demo.sh: line 15: syntax error: unexpected end of file
例:
bash -x demo.sh 显示运行过程
++ uniq
++ gawk -F, '{print $2}' test.txt
+ for team in '$(gawk -F, '\''{print $2}'\'' test.txt |uniq)'
+ gawk -v team=team1 'BEGIN{FS="," ; total=0}{
- shell编程,重定向错误信息和正常输出的数据,输出输入文件描述符
- shell编程,sed编辑器的使用及常用命令
- 清除最近三天的日志shell脚本
- shell编程,对bash脚本进行语法检测
- shell编程,命令替换$(),<输入重定向,<<内联输入重定向,>输出重定向,>>追加输出重定
- shell编程,处理用户输入,选项和参数的处理getopts,shift,常见的linux命令选项
- shell编程,while循环,until循环命令
- linux的shell,which,type,history,alias,coproc后台模式,协程,子shell
- 批量安装node_exporter脚本
- shell编程,字符串切片分割工具${},cut