I was trying to process a directory of over 10000 files using ksh in Cygwin in Windows 7 and have found that it can take well over a minute before processing can begin because I start by doing an
ls -r | while read....
I can get all the files in a few seconds by doing a
set *
for file; do
but that isn't in the date order. The only way I have found around it right now is by running a MSDOS shell and using "dir" like this:
cmd /c "dir /b /a-d /o-d" | while read...
Is there any simple way of doing this without having to run a dos shell and why does "ls" take so long anyway?
Thanks.