Thank You felipe and ygemici. That works. Since the file names remain constant ( the date alone changes for every three days) how can we modify the code to run these scripts for every three days?
vinturin thanks for your updates. My way of testing also same. But now i struked up with comparing the file count. I want to disaply the count only if all customer files exits in server with data say 10 files.
The variable files_total_cnt should have value 10 then get the counts from mall 10 files.
#!/bin/ksh
path=/folder1/folder2/folder3/folder4/folder5/
cd $path
actualdate=`date +"%Y%m%d" -d "2 day ago"`
echo $actualdate
files_total_cnt=$(ls -l mcvp_fmc_usa_*.$actualdate) | some thing trying to get actual file cnt.....
if files_total_cnt > 10
then
for file in `ls -1 customer_data*.actualdate`; do echo "$(expr `wc -l<$file` - 2 ) "$file"" ; done
else
echo "some files are missing"
fi
note am getting count for 2 days old file so i coded in that way.
---------- Post updated at 02:53 PM ---------- Previous update was at 02:24 PM ----------