Reputation: 27
I have many scripts where I make use variables within the scripts. While the script is running, can I issue a command within the script to dump all of the variables and their values?
Upvotes: 1
Views: 1832
Reputation: 35068
If you are after a way of helping you debug your script, you could put
set -x
At the beginning of your script that will display command traces including how your variables are used.
Upvotes: 5
Reputation: 6768
The command env
on its own should display all the variables.
The builtin command set
on its own will also dump the variables.
Note that inherited variables will also be dumped.
Upvotes: 4