I'm trying to pull up the latest Drupal release, and download it via a bash script.
I don't have any idea on how I can do that, except that I found out I can list the files on the FTP server, and get all the filenames containing Drupal, like so:
lynx --dump http://ftp.drupal.org/files/projects/ | awk '/http/{print $2}' | grep drupal-7 > latest.txt
How I can pull the latest version from that list, and download it?
sort
with version sort option i.e.sort -V
. Assuming you don't want dev, alpha or beta (untested):lynx --dump http://ftp.drupal.org/files/projects/ | awk '/http/{print $2}' | grep drupal-7 |sort -V |grep -v dev|grep -v alpha|grep -v beta|tail -n 1