This option is used to print a sorted list of global variables, their types, and final values to file. By default, it prints this list to a file named awkvars.out in the current directory. It is good to have a list of all global variables to avoid errors that are created by using the same name function in your programs. The following is the command to print the list in the default file:
$ awk --dump-variables ' '
This can also be performed as follows:
$ awk -d ' '
On execution of this command, we will have a file with the name awkvars.out in our current working directory, which has the following contents:
$ cat awkvars.outARGC: 1ARGIND: 0ARGV: array, 1 ...