Skip to content

Instantly share code, notes, and snippets.

@audy
Created March 23, 2018 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save audy/5020f7bfb9115795eb3083922413b22d to your computer and use it in GitHub Desktop.
Save audy/5020f7bfb9115795eb3083922413b22d to your computer and use it in GitHub Desktop.
Download all of GreenGenes database from SecondGenome
#!/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