I've never written a script before, and know very little about them. (I've googled, and just got confused.)
If I want to run a heap of movepages.py commands, it seems like I should use something like:
#!/bin/sh python movepages.py -from:"abc (from Wikipedia)" -to:"abc" -log:movelog python movepages.py -from:"xyz (from Wikipedia)" -to:"xyz" -log:movelog
etc
My questions:
- If I place the script in my pywikipedia directory, do I still need to add a *cd pywikipedia/* or equivalent after the first line? - I've seen *rundate=`date +"%FT%T%z"` *used after the cd command, but I can't figure out what this does. Is it needed?
If I place the script in my pywikipedia directory, do I still need to add a cd pywikipedia/ or equivalent after the first line?
If pywikipedia is your current working directory, you needn't use cd command in your script. Simply run your script as (for example) ./your-script.sh (if it has executable right set) or . your-script.sh (dot space scriptname) if it hasn't.
I've seen rundate=`date +"%FT%T%z"` used after the cd command, but I can't figure out what this does. Is it needed?
It assigns current date and time in specified format to shell variable named rundate. I don't know what someone did with this timestamp hereafter, but you don't need it.
Milda