It works if i do process one by one file until there are no files.
I don't want to pick any files which arrive after my process is invoked. So I am checking whether the files exists, If exists i write all files into one one file, then i take the file name from that file and do the actual process.
cd /var/opt/input
filecount=$(find . -type f -name *.csv | xargs wc -l)
if [ $filecount -gt 0 ]
then
echo "Number of Files are $filenumber"
else
echo "No Files"
fi
When the Input locations has huge number of files it is giving error saying
Could you please give some info about using the command with $ and `` as i used `` in same command it took long time so cancelled, when i use $() it worked quickly and got the answer.
Thanks
---------- Post updated at 05:31 AM ---------- Previous update was at 04:10 AM ----------
Again, there is problem in writing all these file names into one text file. It is giving me the same problem(arg list too long).
Alos please advise how do we write all these file name into one file which will be readable by While in script for processing each file.
Thanks
---------- Post updated at 08:41 AM ---------- Previous update was at 05:31 AM ----------
I have done this acheived it but still there is one problem while writing filenames in text file. File names are written as