Changes between Initial Version and Version 1 of CookBookScriptsDjget


Ignore:
Timestamp:
Oct 31, 2005, 7:13:55 AM (19 years ago)
Author:
rock@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CookBookScriptsDjget

    v1 v1  
     1A bash script to fetch files from the Django website.
     2
     3Example usage:
     4
     5{{{
     6cd ~/mytemplates
     7djget http://code.djangoproject.com/browser/djangoproject.com/django_website/templates/base_community.html
     8}}}
     9
     10This fetches the named file and puts it in the current directory with the basename which, in this case, is base_community.html.
     11
     12Here is the script:
     13
     14{{{
     15#! /bin/bash
     16filename=$1
     17filebasename=`basename ${filename}`
     18wgetfilename=${filename}?format=txt
     19wget ${wgetfilename}
     20if [ $? = 0 ]; then
     21    mv ${filebasename}?format=txt ${filebasename}
     22else
     23    echo wget failed for ${filename}
     24fi
     25}}}
Back to Top