Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can I cause BASH to echo all source when it is invoked?

Suppose I have a complex bash script:

x.sh
#! /bin/bash
. include/this/script.sh
. include/this/other/script.sh 
...
foo="foo$bar"
echo $foo

Is there some setting or way to cause BASH to echo all the source code it sources, including the main script when I invoke it, so I know exactly what is going on?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The proper way, without debugging garbage:

set -v
. include/this/script.sh
. include/this/other/script.sh 
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading