I have a script that needs to CAT a number of files, in numerical order. Whilst it seems to work fine with a couple of hundred files, I am now experiencing some "interesting" results in handling a larger file.
The file in question has been split into 1289 individual files, named ABC.001-1289 to ABC.1289-1289
I'm using "ls -gGo ABC* | sort -hk9" to list the files in, what I would deem to be, a human readable sort order. All goes swimmingly until I hit ABC.763-1289:
ABC.001-1289 .. ABC.763-1289
ABC.1000-1289 .. ABC.1040-1289
ABC.764-1289 .. ABC.999-1289
ABC.1041-1289 .. ABC.1289-1289
I'm thinking some sort of buffer overrun or something, but I've not experienced something like this before and am kinda scratching my head into where I would even start looking to remedy the issue.
I've tried altering the "k" value and even removing it, with little positive outcome.
The more I look into this the more I believe a KEYDEF is required, but I can't ascertain the correct format to use this....
Any thoughts?