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.sh

Related terms

Taught in

References