Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You could always try the "-x" flag, which will exho each command in the script as it runs. If you need to actually watch processes forking and terminating, you're probably going to need to have bash run the script under a debugger such as gdb.
if you need low level kernel trace (file i/o, fork, memory handling and similar) you can use strace: strace -o result [-f] <command>
it will work not only for shell script but for apps also.
A debugger is a piece of software that can be run on any distribution.The tools mentioned above (strace, gdb, the -x flag) will work on any distribution.
What if I use TOMOYO Linux? does it work as a debugger?
TOMOYO is a path-based MAC. In the sense of debugging access you could use it in learning mode but as others already said look at distro-agnostic tools first as having to install TOMOYO just for debugging a script would be disproportional.
It could be helpful if you would elaborate what the problem exactly is you're trying to solve.
A good logging system within bash's script would be helpful as well.
what do you mean by that? something like log4j in java? in general the shells have no such library collections, but in special cases you can [only] implement such features. For example the service start/stop environment has common scripts and functions.
what do you mean by that? something like log4j in java? in general the shells have no such library collections, but in special cases you can [only] implement such features. For example the service start/stop environment has common scripts and functions.
TOMOYO is a path-based MAC. In the sense of debugging access you could use it in learning mode but as others already said look at distro-agnostic tools first as having to install TOMOYO just for debugging a script would be disproportional.
It could be helpful if you would elaborate what the problem exactly is you're trying to solve.
man I love your answers... I just like to see processes invoking/forking other processes in a path-based way, TOMOYO looked cool in a video I watched, unfortunately it seems I cant find a debugger that shows the output in a way similar to TOMOYO
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.