I need to check if there are 12 files landed in a dir. This loop works fine when there is a one file and it will loop 4 times with "sleep 300". but when there are no files at all, it fails and does not loop. what else can I add to make it loop even with NO files at all. In short, I want to check 20 mins for file delivery.
retry() {
attempt_num=0
while [[ `ls -1 *File*${JulianDate}.* | wc -l` -lt 12 ]]
do