debugging in bash!!! help needed

Hi all,

Am using bash shell.
Am newbie, trying to understand the debugin process of a shell script...
I am unable to comprehend the control flow ,meaning from where exactly the execution of the script begins...

I tried using bash-xv <scriptname> but since am new ,am finding it difficult to understand the script..

Can anyone help me and let me know how to read the output of bash-xv <scriptname>...
I would also like to know of and good doc on the web that explains this in detail....

Help would be much appreciated!!!!

You can remove 'v' option (Verbose) and try the below -

bash -x <scriptname>

If you are not clear of any specific command...then you can check using
man <command>

Hope this helps. :slight_smile:

Hi,
I am having difficulty in understand the control flow of the script...
With many functions involved ,it was kinda difficult to get through...

So i would like to know if there is any command that would follow the execution line by line(more understandably) ...
I mean something like using F7 in C/C++ to understand the flow of calls to funcs and so on!!!!

I can understand simple scripts but the complex ones still elude me...
So if there are any E-books that could help me i would love to have it...

Please advice