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编程,定时运行作业at,atq,atrm,一次性定时任务
- shell编程,桌面环境中的脚本,select命令,dialog包的使用,kdialog、gdialog、zenity
- shell编程,循环语句for,字段分格符IFS
- shell编程,处理用户输入,选项和参数的处理getopts,shift,常见的linux命令选项
- shell脚本对 mongo 备份并导入
- shell编程,sed编辑器的使用及常用命令
- shell编程,在/tmp中创建临时文件或目录,mktemp
- 发送消息到飞书告警脚本
- shell编程,定期执行脚本cron,crontab,anacron,定时任务
- shell编程,字符串切片分割工具${},cut