How can you display how a bash script would look like with the variables expanded?
I want see how what the script would actually execute, without doing any damage.
How can you display how a bash script would look like with the variables expanded?
I want see how what the script would actually execute, without doing any damage.
There are three relevant options:
-n
- do not execute-v
- show the code as it is read-x
- show the code as it is executedAFAIK, you can't see the expanded variables with -n
in effect, but you can't avoid executing code unless -n
is in effect. So, roughly, you have to execute the script to see the expanded variables.
If you don't execute the variable assignments then there's nothing to expand.