ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
:-) That's not what I mean by automatically! I would not like to modify the script! And with read I wouldn't be able to stop after commands embedded in ``!
I can not say that I know of a way to do that. You might want to look into the --debugger option for bash to see if there is anything there that will help you to debug a script.
I don't think there's any "Visual Studio-like" IDE for debugging, if that's what you mean.
Usually a few debug "echo" statements (the shell equivalent of "printf") is all you need.
"bash/sh/ksh -x myscript" is a good technique.
Equivalently, you can also add a "set -x" at the part of the script where you want to start tracing, and a corresponding "set +x" where you want to stop tracing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.