I have a .ksh script on our AIX 5.x box which goes to a specific directory every hour and pulls the files to process and send to another server via ftp. However, when the number of files becomes large (tonight there were almost 6000 of them, other times there are zero or just a couple of dozen) my code
fails with the 'list too long' error.
Is there another way to pull a directory listing when the directory has thousands of files in it? Also, at some point the script needs to 'mv' and 'cp' this same number of files so I need to know if there is another way to perform those actions on a large number of files as well.
I've tried 'xargs' and 'exec' without success - but admittedly I haven't ever used them before so I may not have understood what I was doing.
Any help appreciated.
Tnx.
Tom
"My mind is like a steel whatchamacallit ...
Code:
ls -1 > filelist.dat
fails with the 'list too long' error.
Is there another way to pull a directory listing when the directory has thousands of files in it? Also, at some point the script needs to 'mv' and 'cp' this same number of files so I need to know if there is another way to perform those actions on a large number of files as well.
I've tried 'xargs' and 'exec' without success - but admittedly I haven't ever used them before so I may not have understood what I was doing.
Any help appreciated.
Tnx.
Tom
"My mind is like a steel whatchamacallit ...