PS4
The bash variable that sets the prefix printed before each line of set -x trace output, a plus sign and a space by default.
In more detail
Adding the bash variables for the current file and line number to PS4 labels every trace line with where it came from. That makes long traces much easier to follow back to the source.
Example
PS4='+ ${BASH_SOURCE}:${LINENO}: ' bash -x script.shRelated terms
- bash -x — Tracing mode, turned on with bash -x or set -x, in which bash prints each command after expansion, just before running it.
- shell prompt — The short text, often ending in a dollar sign, that the shell prints to show it is ready for your next command.
Taught in
- Debugging: set -x, bash -n And Reading The Error — Bash Scripting & Command Line Automation