set-option

xtrace

Trace expanded commands and arguments. Default trace stream is stderr. Disable before sensitive operations.

Formal Syntax & Structure

bash syntaxbash
bash -x script; set -x; set +x

Return Value

shell option

Trace expanded commands and arguments. Default trace stream is stderr. Disable before sensitive operations.

Working Example

Example Snippetbash
PS4='TRACE: 'set -xname=demoset +xprintf '%s\n' "$name"
Bash Reference