Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Awk debugging - beginner  (Read 329 times)

Weaver

  • Addicted Kitizen
  • *****
  • Posts: 7292
  • Retd sw dev; A&A; 4 × 7km ADSL2; IPv6; Firebrick
Awk debugging - beginner
« on: November 22, 2018, 08:11:34 AM »

I write a very simple Awk program which is behaving bizarrely, because I have no clue what I am doing. I have gawk installed and I read that it has a debugger built in.

However I have no idea what I am doing, I tried
    gawk -D -f myawk.awk    the_input_textfile_for_myawk
No error message from that. But then I am lost. I have no idea what to do. I wanted to try single stepping through it. Every command I have tried produces the message ‘program not running’. I looked st the manual on the web. It talks about setting breakpoints in functions. I don’t have any, just regex matching rules and blocks of variable assignments. It is supposed to be structured like a state machine with regex matches to trigger the state transitions. I do indeed have no clue what I am doing.
Logged

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 39437
  • Penguins CAN fly
    • DSLstats
Re: Awk debugging - beginner
« Reply #1 on: November 22, 2018, 09:23:47 AM »

If you type "man gawk" you'll get a full description of the features. To run an interactive debugging session, add "--debug" to the command line.
Logged
  Eric