View Single Post
  #5   (View Single Post)  
Old 16th January 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

If you change

Code:
SITES='
/home/www/site-1
/home/www/site-2
/home/www/site-3
'
to:

Code:
SITES=${SITES:-'
/home/www/site-1
/home/www/site-2
/home/www/site-3
'}
You can also override the default list of sites by exporting the SITES environment variable before you run the script. E.g. $ SITES="/a /b /c"; export SITES; run-script-here. Other variations of possible, if you read the shells manual page about expansions.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote