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

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

相关推荐
m0_5127446417 分钟前
Nginx(详解以及如何使用)
运维·服务器·nginx
小丑西瓜6661 小时前
分布式简单理解
linux·redis·分布式·架构·架构演变
高hongyuan1 小时前
计算机网络
linux·计算机网络
EPSDA2 小时前
Linux线程池
linux·运维·服务器·开发语言·c++
我爱蛋蛋后2 小时前
Linux驱动开发之音频驱动与基础应用编程
linux·c语言·驱动开发·音视频
你好呀我是裤裤3 小时前
Linux基础开发工具的使用(apt、vim、gcc、g++、gdb、make、makefile)
linux·运维·vim
望获linux3 小时前
如何在望获实时 Linux & 京博航友善 NanoPC-T6 上部署 Docker
linux·运维·服务器·docker·eureka·开源软件
wangchen_03 小时前
linux编译器和自动化构建工具(gcc与Makeile)
linux·运维·服务器
DC_BLOG4 小时前
Linux-Ansible命令
linux·运维·服务器·ansible
人工干智能4 小时前
科普:“docker”与“docker compose”
运维·docker·容器