@gnsxhj,
Thanks for the response. Yes, that was one of the things I tried. But it didn't work so long as I was using a variable named "counter". Works perfectly with a variable name like "x" though :)
@PHV - Oh, so it has a special meaning and is not actually the value of my variable as I was thinking? Well that would explain why it didn't work. Thanks!
Thanks for the reply.
Sorry that was a copy/paste error. I tried so many things. When arr[x] did not work, I tried using a hard coded index [1] to see if it changed the results and posted that by accident.
What finally worked was changing how and where I incremented the counter value. I...
I am new to awk and have created a very simple script. It should read file lines into an array and print all lines in the END block. But when I test it nothing prints except the counter value:
1:: (should be something here ...)
2::
3::
4::
...
Could someone please tell me what I am doing...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.