Skip to main content

REPORTS - diagnostic script

#!/bin/bash
CSV="$1"
ROOT="$2"

cat "$CSV" | while IFS=',' read -r idx amount date; do
  pattern="${date}---*---${amount}.pdf"
  match=$(find "$ROOT" -type f -iname "$pattern" | head -n 1)
  if [ -z "$match" ]; then
    echo "NOT FOUND | pattern=[$pattern] | idx=$idx"
  fi
done