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

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

相关推荐
小五传输28 分钟前
内外网文件交换系统产品推荐 解决隔离网络文件交换5类难题
大数据·运维·安全
AOwhisky29 分钟前
Linux(CentOS)系统管理入门笔记(第一期)——从 Multics 到主流发行版
linux·运维·笔记·centos·云计算
从零开始的代码生活_29 分钟前
Linux epoll 多路转接详解
linux·运维·网络·后端·tcp/ip·计算机网络·php
渣渣盟38 分钟前
Linux软件管理与编辑器命令速查手册
linux·运维·编辑器
姚不倒38 分钟前
F5 健康检查 Monitor 深入篇
运维·负载均衡·f5
小鹿软件办公42 分钟前
通过调整编码参数使用 VLC 媒体播放器无损压缩视频方法
运维·网络·音视频
无足鸟ICT1 小时前
【RHCA+】扩展正则表达式
linux·正则表达式
一池秋_1 小时前
ubuntu(linux)完美复刻windows11字体,解决linux字体费眼晴
linux·运维·ubuntu
随风一样自由1 小时前
【WSL+Linux】国内网络连接微软官方服务器(或GitHub)不稳定,导致下载内核或Linux发行版时超时断开如何解决?
linux·服务器·wsl
川石课堂软件测试1 小时前
性能测试|Nginx中间件监控与调优
linux·python·nginx·中间件·单元测试·压力测试·harmonyos