Originally Posted by grail
You may need to explain further as the example seems unclear to me?
The awk scripts I've written have been simple and straightforward, and were no problem to get running. My latest one is more complex, and raises the question "how to debug awk?" --lint is not helping, so, after each line of awk code I want to add a line that prints the current value of all the variables referenced in the previous line.
By hand, that is going to be very tedious, so I want to write a vim script that will generate the desired print line from the content of the current line. Unfortunately, every time I try to write vimscript I enter an endless loop of help lookups to explain an unfamiliar term in the previous help lookup. After 4 or 5 of these I enter a comatose state in which I stare at the monitor for a while before erupting with "fu*k it, I'll write the damn thing in bash instead".
Which I have done in this case also. But it would be much cleaner if I did it within vim.
So here is the immediate problem. From a line of awk code, in vim extract each varaiable or array reference, and eliminate the duplicates.