diff --git a/data_processing/scripts/download_opencorporates.com.sh b/data_processing/scripts/download_opencorporates.com.sh index b6c7d93..264ce54 100755 --- a/data_processing/scripts/download_opencorporates.com.sh +++ b/data_processing/scripts/download_opencorporates.com.sh @@ -1,7 +1,11 @@ #!/bin/bash -sshpass -p "${SFTP_PASSWORD}" sftp -q -P "${SFTP_PORT}" "${SFTP_USERNAME}@${SFTP_ENDPOINT}" <" | awk '$1 ~ /^-/ {print $NF}' \ No newline at end of file +while IFS= read -r line; do + file=$(echo "$line" | awk '{print $2}') + sshpass -p "${SFTP_PASSWORD}" sftp -q -P "${SFTP_PORT}" "${SFTP_USERNAME}@${SFTP_ENDPOINT}" <