Execution Trace

noun

say it: “ek-suh-KYOO-shun TRAYS” /ˌɛksəˈkjuʃən ˈtreɪs/

A printed record of every command a script runs, shown right before each one runs, with its values filled in.

What is an execution trace in bash?

An execution trace shows what a script really did. bash -x script.sh prints each command right before it runs, with every variable replaced by its value, so a wrong path stands out. + marks a command and ++ one inside $( ). set -x and set +x trace one part only.

bash -x ./mover.sh inbox photos
# + src=inbox
# ++ basename inbox/IMG_0412.jpg
# + name=IMG_0412.jpg
# + [[ -e photos/inbox/IMG_0412.jpg ]]

In a sentence

  • “The execution trace showed the script checking photos/inbox/IMG_0412.jpg, a path that would never exist.”
  • “Sam sent the execution trace into less to read it page by page.”

Level: Journeyman · More Unix terms at this level

Updated