Hi,
may i know the tips for debugging any awk script? Please feel free to share if you have any.
Thanks
Hi,
may i know the tips for debugging any awk script? Please feel free to share if you have any.
Thanks
Use the print statement in your code to print out values of variables/return values and so on. If you are using gawk, you can use the -W dump-variables[=file]
option to dump variables out to a file for debugging. Also, the option -W lint[=value]
might be of interest. See the documentation for more. Other version of awk, such as pgawk provides profiling.
A page of the sed/awk book on debugging for your reference.