Shell Debug
来源:互联网 发布:网络暴力赚钱项目 编辑:程序博客网 时间:2024/06/05 13:36
适合ksh, bash
1. 使用trap命令
# 追踪命令或函数的返回状态trap 'echo "[LINE:$LINENO] Error: Command or function exited with status $?"' ERR# 追踪命令执行后的详细结果trap 'echo "Before execute line $LINENO: a=$a, b=$b, c=$c"' DEBUG
2. sh选项
-n 读取shell脚本,但不执行(检查语法)
-x 进入trace方式,显示执行的每条命令
-c 从字符串中读取命令执行
sh -c 'a=1; b=2; let "c=a+b"; echo $c'# 增强-x输出:export PS4='+{$LINENO:${FUNCNAME[0]}}
0 0
- debug shell
- SHELL DEBUG
- Shell Debug
- shell debug
- Erlang shell debug调试
- Shell 脚本 Debug 方法
- shell script的debug
- shell bashdb debug
- Simple Shell for Application Debug
- shell常用的debug方法
- Shell Script - 追踪与debug
- linux shell脚本的debug
- shell script 的调试 debug
- Debug your shell scripts with bashdb
- shell script 的追踪与 debug
- shell script 的追踪与 debug
- EDK2 环境搭建 & Shell - Debug (cmd)
- 第16章 Debug Shell脚本
- Scala 统计一个文件夹下面所有单词出现的次数
- 405, HTTP Status 405 - JSPs only permit GET POST or HEAD.。
- 扩展欧几里得算法
- 从零开始搭建Node.js, Express, Ejs, Mongodb服务器
- VMware上的ubuntu14.04与win7共享文件夹
- Shell Debug
- Jetty实战之 安装 运行 部署
- 12C ORA-错误汇总18 ORA-57000 to ORA-65535 EXP-00000 to EXP-00114 IMP-00000 to IMP-00402 SQL*Loader-0010
- qmake的使用
- BC22hdoj5142&&hdoj5143&&hdoj5144
- Java多线程之Fork/Join
- 新智元【Yoshua Bengio 亲自解答】机器学习 81 个问题及答案(最全收录)
- APP测试大纲
- 字节流与字符流