Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If anyone has heard of Bukkit, you know that their files are usually of three types: Development, Beta, and Realease. Click (here) for examples. I need a script that:

  • Loops through the directory
  • Gets the latest Stable version (probably just as simple as looking at the version number as they have a simple naming convention, each stable version is succeeded by -Rx.0, while developmental and beta versions are succeeded by -Rx.x)

After that I know I'll need to use wget to download the file.

Note: If your just going to post code, at least tell me what it does so I can use it later if I need to

share|improve this question

The script's main task is to figure out which of those links it should wget. Parsing web pages is really complicated. I wouldn't recommend bash for it!

Python is easy to write in comparison and has a robust HTML parsing library called Beautiful Soup.

Once you've "souped" the link, downloading it is trivial.

share|improve this answer

It took me some time to figure this out, but here it is ;)

-c , in case you want to stop and start from where you left it

-r -A "-R[0-9].0" , gets only files that have in the middle -Rx.0 and x belonging to {0,1,...9}

-np , means no parent directories (goes with the -r option)

-nd , stands for no directory

-e robots=off , turn off robots

So in your case you would do something like

wget -c -e robots=off -r -np -nd -A "*-R[0-9].0*"

I can't get it from the site you posted, but I think it somehow redirects things here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.