Skip to content

Instantly share code, notes, and snippets.

@dirkk
Created April 17, 2014 13:23
Show Gist options
  • Save dirkk/10983081 to your computer and use it in GitHub Desktop.
Save dirkk/10983081 to your computer and use it in GitHub Desktop.
Download all distributions of the latest BaseX snapshot
#!/bin/bash
PA=$HOME/BaseX/latest
URL="http://files.basex.org/releases/latest/"
rm -rf $PA
mkdir $PA
# Get all file paths
FILES=`basex -q "distinct-values(http:send-request(<http:request method='get' href='$URL'/>)//div[@id='files']//table/tr/td/a/@href[starts-with(., 'BaseX')]/string())"`
for FILE in $FILES
do
wget -O $PA/$FILE $URL$FILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment