SyntaxFix
Write A Post
Hire A Developer
Questions
set -x is fine, but if you do something like:
set -x
set -x; command; set +x;
it would result in printing
+ command + set +x;
You can use a subshell to prevent that such as:
(set -x; command)
which would just print the command.