In following some random directions on the internet, trying to debug an issue of mine at a shell (I use zsh), I ran set -x
. Thanks to this I figured out my issue. However, I'm now in an awkward position of not knowing how to turn this debugging off -- I really don't even understand what I did in the first place, you see.
I also figured out that I could just do zsh
and get a new shell. The obvious unset -x
does not work. I would like to know the correct way. Thanks!
Update:
Found this unix&linux stack exchange post about what -x
does. Still don't know how to turn it off.
$ set +x # is the opposite of set -x, and will reverse what you typed.
It can be enabled on the command line or on the sh-bang line by providing -x or by the set -x statement. It can be disabled using the set +x statement.
The set -x command is used to debug bash script where every executed statement is printed to the shell for debugging or troubleshooting purposes. The set -x command can be directly executed in an interactive bash shell or can be used inside the bash script.
Undo changes in vim / ViType u to undo the last change. To undo the two last changes, you would type 2u . Press Ctrl-r to redo changes which were undone.
You can use set +x
to switch it back. The output of help set
describes this:
$ help set
set: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
...
-v Print shell input lines as they are read.
-x Print commands and their arguments as they are executed.
...
Using + rather than - causes these flags to be turned off. The
flags can also be used upon invocation of the shell. The current
set of flags may be found in $-. The remaining n ARGs are positional
parameters and are assigned, in order, to $1, $2, .. $n. If no
ARGs are given, all shell variables are printed.
Note the “Using +
rather than -
causes these flags to be turned off” part.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With