#!/usr/bin/env bash set -eau -o pipefail if [ "$#" -ne 2 ]; then echo "Usage: ingest path-to-directory-containing-IPE-CSVs path-to-generated-db" echo "" exit 1 fi fullIpeDirPath=$(realpath "${1}") fullDbPath=$(realpath "${2}") tmpSql=$(mktemp) clean_tmp () { rm "${tmpSql}" } trap clean_tmp EXIT echo "[+] Ingesting IPE data." echo " The following files will be ingested." echo "" ipeFiles=$(find "${fullIpeDirPath}" -name '*.csv') cat > "${tmpSql}" <> "${tmpSql}" < "${tmpSql}" < "${tmpSql}" <