Created
March 23, 2018 19:08
-
-
Save audy/5020f7bfb9115795eb3083922413b22d to your computer and use it in GitHub Desktop.
Download all of GreenGenes database from SecondGenome
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 | |
set -euo pipefail | |
function get_source() { | |
curl --silent "http://greengenes.secondgenome.com/downloads/database/13_5" | |
} | |
function get_urls() { | |
get_source | grep 'https:' | grep s3 | cut -d '"' -f 2 | |
} | |
n_urls=$(get_urls | wc -l) | |
echo "--> fetching ${n_urls} files" | |
for n in $(seq 1 ${n_urls}); do | |
url=$(get_urls | head -n ${n} | tail -n 1) | |
echo="--> downloading ${n} ${url}" | |
wget ${url} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment