[opensuse] BASH - Better way to debug bash script??
Listmates, Another simple question I'm looking for a better answer to. What is the best way to step line-by-line through bash script for debugging? I found the following, that works, but it just doesn't seem like an elegant solution for longer scripts: #!/bin/bash set -x trap "read x" DEBUG What are the other tools that will do this? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 04 April 2009 20:08:43 David C. Rankin wrote:
Listmates,
Another simple question I'm looking for a better answer to. What is the best way to step line-by-line through bash script for debugging? I found the following, that works, but it just doesn't seem like an elegant solution for longer scripts:
#!/bin/bash set -x trap "read x" DEBUG
What are the other tools that will do this?
I haven't used it much, but bashdb looks very useful to me. It allows you to do to a bash script what gdb lets you do to a C program. I've only used it a little so I'm no great expert, but it has been useful to me. break, step and print are the things I use the most in a debugger anyway Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anders Johansson wrote:
On Saturday 04 April 2009 20:08:43 David C. Rankin wrote:
Listmates,
Another simple question I'm looking for a better answer to. What is the best way to step line-by-line through bash script for debugging? I found the following, that works, but it just doesn't seem like an elegant solution for longer scripts:
#!/bin/bash set -x trap "read x" DEBUG
What are the other tools that will do this?
I haven't used it much, but bashdb looks very useful to me. It allows you to do to a bash script what gdb lets you do to a C program.
I've only used it a little so I'm no great expert, but it has been useful to me. break, step and print are the things I use the most in a debugger anyway
Anders
Thanks Anders, That's what I was looking for! -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (2)
-
Anders Johansson
-
David C. Rankin