I have 3 files like below:
CV_REF_DATA_09012021.txt
DB_ONLINE_CL_09012021.txt
DFR_CL_INS_09012021.txt
I want to check if the files are present in /NAS/CFG/ and then add it to an array. It’s not required that all the 3 files are present at all times. So, it can either be 1, 2 or all the 3 files. If there are no files the script should exit saying the same. Next I want to loop based on the array and run a “call” script.
The call script uses the file pattern to check the file count as well. Below code from call script.
NASFilecnt=`find . -type f -name "${CV_REF_DATA}*.txt" | wc -l`
So, how can run the loop based on the above. Please let me know if there are any queries.