Linux: shell: bash: set -x;调试使用

man bash

set -x

-x After expanding each simple command, for command, case command, select command, or arithmetic for command, display the expanded value of PS4, followed by the command and its expanded arguments or associated word list.

这个可以帮助将变量的实际赋值情况打印出来。帮助调试使用,实现了单步调试的功能。非常的方便。

https://stackoverflow.com/questions/38335552/how-to-store-exclude-arguments-for-grep-in-an-environment-variable-in-a-bash-s/79259586#79259586

比如上面这个问题,就可以使用。但是首先需要有这个意识,这个知识,知道这个途径。

相关推荐
真正的醒悟8 分钟前
2025【1460天】网络工程师经验之道
运维·服务器
Nimsolax14 分钟前
Linux信号
linux
ajassi20004 小时前
开源 C++ QT Widget 开发(十五)多媒体--音频播放
linux·c++·qt·开源
JosieBook5 小时前
【远程运维】Linux 远程连接 Windows 好用的软件:MobaXterm 实战指南
linux·运维·windows
文档搬运工5 小时前
Linux MInt启动速度的优化
linux
Broken Arrows6 小时前
Linux学习——管理网络安全(二十一)
linux·学习·web安全
Light606 小时前
领码方案|Linux 下 PLT → PDF 转换服务超级完整版:异步、权限、进度
linux·pdf·可观测性·异步队列·plt转pdf·权限治理·进度查询
羚羊角uou7 小时前
【Linux】命名管道
linux·运维·服务器
IT 小阿姨(数据库)7 小时前
PgSQL监控死元组和自动清理状态的SQL语句执行报错ERROR: division by zero原因分析和解决方法
linux·运维·数据库·sql·postgresql·centos
THMAIL7 小时前
量化股票从贫穷到财务自由之路 - 零基础搭建Python量化环境:Anaconda、Jupyter实战指南
linux·人工智能·python·深度学习·机器学习·金融