Kitz Forum

Computer Software => Linux => Topic started by: Weaver on November 22, 2018, 08:11:34 AM

Title: Awk debugging - beginner
Post by: Weaver 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.
Title: Re: Awk debugging - beginner
Post by: roseway 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.