I think most of what needs to be said about the technical aspects of this user's question has been said. But I want to make a few suggestions for future practice, both for this mailing list and for the OP.
In the gawk-bug list (which is structured very much like this list), they have a setup where when you post, you're supposed to affirm two things: 1) That you have read their little document (web address given) about what sorts of things should be posted to help-gawk and what things are OK for bug-gawk. 2) That you have not modified the source code before compiling it (and/or that if you did modify it, what you did and why). It seems to me that we should have a similar requirement here that you've run your code through "shellcheck" (www.shellcheck.net) first before posting. As it turns out, shellcheck would have caught the issue raised by OP, and I can remember at least one previous thread here where this was also the case. To the OP: This is not intended as a criticism. I really like shellcheck, and I hope you do, too - even though a lot of what it complains about can/should be ignored (*). (*) Example: I frequently do: set -- $foo specifically to split foo up into $1, $2, etc. But shellcheck flags this as: Did you mean: set -- "$foo" Yes, I get that you usually do want to double-quote your variables, but there are exceptions (and when I leave a variable unquoted, it is for a reason). I have a pretty long list of "things to ignore" (using the "-e" command line switch on shellcheck) that tells it which things to not report on. Final note: I have only used the command line version of shellcheck. I understand that there is also a "paste your code to the web page and click OK" version as well. I've never used that. ================================================================================= Please do not send me replies to my posts on the list. I always read the replies via the web archive, so CC'ing to me is unnecessary. Note that they always end up in my Spam file anyway, so it is annoying to have to periodically clean that out.