Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

debugging awk

Status
Not open for further replies.

MrMoonlight

Programmer
Apr 22, 1999
1
US
anyone have tips on debuggin awk scripts?<br>
wish there was a verbose mode (ala csh-x foo.csh)
 
From my experience, basic debugging techniques have always produced the desired results...not always quickly, though.<br>
<br>
If you are 'bailing' without actually running, then I would count your opening and closing braces, check for the proper usage and syntax of tests, keywords and punctuation. Cut out blocks and test again. I have found that removing all my productive blocks and debugging with just my conditional statments has saved me a lot of time, as I've found, this is where I make most of my mistakes. I embed sufficient prints to both let me know where it is, (once it stops bailing), and also to let me see the values I working with, once I can start putting productive blocks back in. <br>
<br>
I have not found or heard of any handy tools for debugging awk scripts but one could probably write an awk script to help do this but it would probably be difficult to debug.<br>
<br>
One other technique I find essential, is simply to walk away every once in a while.<br>
<br>
Murray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top