Created
November 11, 2018 22:13
-
-
Save atomize/57c1585e1a17ceb16bc8994be6b21d96 to your computer and use it in GitHub Desktop.
Set the PS4 variable, which is evaluated for every command being executed just before the execution if trace is on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#You can set the PS4 variable, which is evaluated for every command being executed just before the execution if trace is on: | |
PS4='$(echo $(date) $(history 1) >> /tmp/trace.txt) TRACE: ' | |
#Then, enable trace: | |
set -x | |
#To stop tracing, just: | |
#set +x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment