Version 1 (modified by rock@…, 19 years ago) ( diff )

--

A bash script to fetch files from the Django website.

Example usage:

cd ~/mytemplates
djget http://code.djangoproject.com/browser/djangoproject.com/django_website/templates/base_community.html

This fetches the named file and puts it in the current directory with the basename which, in this case, is base_community.html.

Here is the script:

#! /bin/bash
filename=$1
filebasename=`basename ${filename}`
wgetfilename=${filename}?format=txt
wget ${wgetfilename}
if [ $? = 0 ]; then
    mv ${filebasename}?format=txt ${filebasename}
else
    echo wget failed for ${filename}
fi
Note: See TracWiki for help on using the wiki.
Back to Top