Created
November 1, 2018 11:29
-
-
Save cwpearson/491d6325ace5fcab1d6f02b540157d1f to your computer and use it in GitHub Desktop.
Download gaia data release 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
index_url="http://cdn.gea.esac.esa.int/Gaia/gdr2/gaia_source/csv/" | |
index_html=`curl $index_url` | |
while read -r line; do | |
# echo $line; | |
match=`echo $line | grep -oE 'href\="(.*.csv.gz)'`; | |
# echo $match; | |
match=${match#href=\"} ;# remove prefix starting with 'href="' | |
# echo $match; | |
url="$index_url/$match"; | |
echo $url; | |
ec=18; | |
while [ $ec -eq 18 ]; do | |
curl -O -C - "$url"; | |
ec=$?; | |
done | |
done <<< "$index_html" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment