Debug your shell scripts with bashdb


 
Thread Tools Search this Thread
Special Forums News, Links, Events and Announcements UNIX and Linux RSS News Debug your shell scripts with bashdb
# 1  
Old 11-24-2008
Debug your shell scripts with bashdb

11-24-2008 11:00 AM
The Bash Debugger Project (bashdb) lets you set breakpoints, inspect variables, perform a backtrace, and step through a bash script line by line. In other words, it provides the features you expect in a C/C++ debugger to anyone programming a bash script.



Source...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

"Help debug the shell script"

Hello All, I have got a section of shell script which was working earlier but now it is giving some different results: MSG= while true do themenu getchar = case $answer in 1) export_Config_tables;; 2) export_config_tables_file;; 3)... (1 Reply)
Discussion started by: bghosh
1 Replies

2. Shell Programming and Scripting

Bashdb - new user basic questions

This may be too silly and definitely way to early to ask . I'll admit have read about 5% of documentation so far , but can you make bashdb to step thru the file "automatically" by setting some kind of timeout? and second how do you stop the process ? Is "quit" the only... (1 Reply)
Discussion started by: annacreek
1 Replies

3. Shell Programming and Scripting

Logging perl and shell debug mode.

I have a shell program which calls a perl program. I am running the shell program with command; $ ksh -x <prog_name> Inside the shell program, I am calling perl with warnings. I want to capture the entire output as it comes on screen. The command I tried is: $ ksh -x... (1 Reply)
Discussion started by: som.nitk
1 Replies

4. Shell Programming and Scripting

How to compile or debug line by line in shell script?

I know about bash -x, set -x and -v but disappears from Command Line Interface in fraction of second ...... I am looking for a command or script ..complies each line and shows the output after executing each line ....( similar what we have in C ) Thanks in Advance (2 Replies)
Discussion started by: frintocf
2 Replies

5. Shell Programming and Scripting

Cant debug shell script

Hi I am relatively new in shell scripting Below is the code which i developed but for some reason, it keeps giving me error: /apps/bss/BatchProg/at1/batch/scripts/ksh/TBATLC02.ksh: syntax error at line 41 : `then' unmatched #!/usr/bin/ksh... (4 Replies)
Discussion started by: scripting_newbe
4 Replies

6. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies

7. Shell Programming and Scripting

Please help to debug a small shell script (maybe AWK problem)?

Hi Buddies, The following is shell scripts which was borrowed from linux box for load average check. it runs good. (this structure is simple, when load average is too high, it will send alert to user) #!/usr/bin/ksh # Set threshold for 1, 5 and 15 minture load avarage # configured for... (4 Replies)
Discussion started by: GreatJerry
4 Replies

8. UNIX for Advanced & Expert Users

How can debug our UNIX shell script?

Hi all, i have two simple questions here... 1. i want to know that how to debug the UNIX shell script? 2. is there any way to handling the exception in UNIX shell script like oracle exception handling? Please provide me those details it would be great help/ Thanks and Regards, MPS... (3 Replies)
Discussion started by: psiva_arul
3 Replies

9. Shell Programming and Scripting

what's the debug command for perl scripts

Hi, Can you please let me know if there's any debug command for perl scripts like set -x for shell scripts (2 Replies)
Discussion started by: dayanandra
2 Replies

10. AIX

Difference between writing Unix Shell script and AIX Shell Scripts

Hi, Please give me the detailed Differences between writing Unix Shell script and AIX Shell Scripts. Thanks in advance..... (0 Replies)
Discussion started by: haroonec
0 Replies
Login or Register to Ask a Question
zshdb(1)						User Contributed Perl Documentation						  zshdb(1)

NAME
zshdb - zsh debugger SYNOPSIS
zshdb [options] [--] script-name [script options] zshdb [options] -c execution-string DESCRIPTION
"zshdb" is a zsh script to which arranges for another zsh script to be debugged. The debugger has a similar command interface as gdb(1). If you used zshdb script and need to pass options to the script to be debugged, add "--" before the script name. That will tell zshdb not to try to process any further options. OPTIONS
-h | --help Print a usage message on standard error and exit with a return code of 100. -A | --annotation level Sets to output additional stack and status information which allows front-ends such as emacs to track what's going on without polling. This is needed in for regression testing. Using this option is equivalent to issuing: set annotation LEVEL inside the debugger. -B | --basename In places where a filename appears in debugger output give just the basename only. This is needed in for regression testing. Using this option is equivalent to issuing: set basename on inside the debugger. -n | --nx | --no-init Normally the debugger will read debugger commands in "~/.zshdbinit" if that file exists before accepting user interaction. ".zshdbinit" is analogus to Perl's ".perldb" or GNU gdb's ".gdbinit": a user might want to create such a debugger profile to add various user-specific customizations. Using the "-n" option this initialization file will not be read. This is useful in regression testing or in tracking down a problem with one's ".zshdbinit" profile. -c | --command command-string Instead of specifying the name of a script file, one can give an execution string that is to be debugged. Use this option to do that. -q | --quiet Do not print introductory version and copyright information. This is again useful in regression testing where we don't want to include a changeable copyright date in the regression-test matching. -x | --eval-command debugger-cmdfile Run the debugger commands debugger-cmdfile before accepting user input. These commands are read however after any ".zshdbinit" commands. Again this is useful running regression-testing debug scripts. -L | --library debugger-library The debugger needs to source or include a number of functions and these reside in a library. If this option is not given the default location of library is relative to the installed zshdb script: "../lib/zshdb". -T | --tempdir temporary-file-directory The debugger needs to make use of some temporary filesystem storage to save persistent information across a subshell return or in order to evaluate an expression. The default directory is "/tmp" but you can use this option to set the directory where debugger temporary files will be created. -t | --tty tty-name Debugger output usually goes to a terminal rather than stdout or stdin which the debugged program may use. Determination of the tty or pseudo-tty is normally done automatically. However if you want to control where the debugger output goes, use this option. -V | --version Show version number and no-warranty and exit with return code 1. BUGS
The way this script arranges debugging to occur is by including (or actually "source"-ing) some debug-support code and then sourcing the given script or command string. One problem with sourcing a debugged script is that the program name stored in $0 will not be the name of the script to be debugged. The debugged script will appear in a call stack not as the top item but as the item below "zshdb". The "zshdb" script option assume a version of zsh with debugging support, zsh 4.3.6-dev-2 or later. The debugger slows things down a little because the debugger has to intercept every statement and check to see if some action is to be taken. SEE ALSO
o <http://bashdb.sourceforge.net/bashdb.html> - Until a full manual is written, this manual for a similar bash debugger may give some guidance. The two debuggers have similar command interfaces (and code). o <http://bashdb.sourceforge.net> - the homepage for the project for the family of debugger, zshdb, bashdb. AUTHOR
The current version is maintained (or not) by Rocky Bernstein. COPYRIGHT
Copyright (C) 2009 Rocky Bernstein This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 0.06.git 2010-10-31 zshdb(1)