When I invoke bash with the -x
option, it prints each command before it is executed. However - the commands are printed with a "+ " prefix.
Is there a way to get it to print the commands, but without this prefix? With -x
or without it?
When I invoke bash with the -x
option, it prints each command before it is executed. However - the commands are printed with a "+ " prefix.
Is there a way to get it to print the commands, but without this prefix? With -x
or without it?
You can customize the prefix when using
bash -x
by setting the variable PS4. So in your .bashrc, you could have something like this:Or, if you want to debug something, let it print the line number like this: