home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!vtserf!creatures!csgrad.cs.vt.edu!ramakris
- From: ramakris@csgrad.cs.vt.edu (S.Ramakrishnan)
- Newsgroups: comp.unix.questions
- Subject: Re: Unix Script Debugger
- Keywords: unix script debug
- Message-ID: <3413@creatures.cs.vt.edu>
- Date: 4 Sep 92 23:44:57 GMT
- References: <1992Sep4.201604.717@beaver.cs.washington.edu>
- Sender: usenet@creatures.cs.vt.edu
- Organization: VPI&SU Computer Science Department, Blacksburg, VA
- Lines: 27
-
- In article <1992Sep4.201604.717@beaver.cs.washington.edu> simonson@cs.washington.edu (Kevin Simonson) writes:
- >
- > I've been writing Unix scripts for a little bit now. Whenever I have
- >trouble with one I always end up inserting a bunch of "echo" statements
- >into it to try to figure out what's wrong with it, and this has always
- >solved the problem for me eventually.
- >
- > My question is whether I'm wasting time with this farely brute force
- >method. Does anyone know of a Unix script debugger to solve the problem
- >without editing the script? Or even an automated editor that inserts
- >"echo" statements? Any information on this would be helpful.
- >
- > ---Kevin Simonson
-
- If you are using perl there is a debugger available.
-
- If you are using csh/sh, you can run it in the "debugging" mode
- as
-
- #sh -x <script> or % csh -x <script>
-
- which displays the statements as they are executed and the values of
- the intermediate expressions and variables as a statement is executed.
- Of course, this still doesn't beat having a debugger shc as that for perl.
-
- ---
- S Ramakrishnan, CS Dept, McBryde Hall, VaTech
-