Is it possible to test whether a bash script was executed with -x?
I'm writing a script which also runs some remote scripts, and I'd like to be able to do something like:
USE_X="$( run_with_x && "-x" || "" )"
ssh $host "bash $USE_X some_script.sh"
|
Is it possible to test whether a bash script was executed with I'm writing a script which also runs some remote scripts, and I'd like to be able to do something like:
|
|||
|
|
|
Just look at the
(Yup, I did manage to do that without invoking grep. Save the pids!) |
|||||||||||||
|
|
After reading man pages and grepping for things, here's the solution:
Result:
|
|||
|
|
|
The bash man page documents Also, So, the pipeline |
||||
|
|
|
Probably the simplest way of parsing
or even shorter:
Note that |
||||
|
|