Ah, one mystery solved and a new one introduced!
Your above abbreviated code led me to a discovery. It printed the very first hostname and then threw me an error on the very next file, which is something akin to "batchfile.txt." This is obviously not output from my TCL/Expect script, but rather is a big long list of TCL commands and Expect interactive stuff that I paste into my TCL shell to create all of the .txt files I'm performing post-analysis on with these new scripts you have helped me to create. At the end of every one of those TCL commands is something like "router1.txt," which is precisely what creates the .txt files with an embedded hostname in the file. Not sure how, but that was clearly a problem for xargs. I converted all non-router/switch text files to a .xtx extension and then ran the script and now I have something more along the lines I was hoping for. HOWEVER...
My output file right now is "out5.txt." Towards the very end of this file, I actually see an entry of "out5" as if it were a hostname, and then a very VERY long comma-separated line of 'ntp server' and 'ntp peer' strings. So somehow the script is actually catching up to itself before it completes. Right? I suppose I can just exclude output file from being evaluated as input, no?
---------- Post updated at 02:27 PM ---------- Previous update was at 02:00 PM ----------
Just dawned on me that I had stopped using .csv in my output file so that I wouldn't have to do "Open With" and could just open it directly in my text editor. I will, however, go back to .csv for production stuff and then this simply wouldn't be an issue!
OK, time for a nice cold beer!
