home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / question / 10753 < prev    next >
Encoding:
Text File  |  1992-09-07  |  1.5 KB  |  40 lines

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