Posted by Maxim Heijndijk on 01/21/07 09:40
Koncept schreef:
> In article <45b2547a$0$55713$dbd43001@news.wanadoo.nl>, Maxim Heijndijk
> <maccus_nospam@orange.nl> wrote:
>
>> . ./genpages.conf
>
> What does this configuration file look like? Could you post a few
> lines? Everything else is a breeze to cover in PHP.
>
> BTW... Instead of using `expr` you can use the following syntax in bash
> and save a call to an external operation:
>
> NEXT=$(($LOOPCOUNT+1))
>
> You also have the option of coding your UNTIL loop:
>
> until [ "${LOOPCOUNT}" -ge "${PAGES}" ]; do
>
> like this:
>
> for ((i=0;i<=$PAGES;i++)); do
> # content...
> done
>
> And for the HTML bit, you could have used HEREDOC syntax so that you
> didn't have to escape all the sub-quotes:
>
> cat <<EOF > "${ROOTDIR}/${SUBDIR}/${LOOPCOUNT}.html"
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=utf-8"/>
> <title>This is a template</title>
> </head>
> <body>
> <!-- content -->
> </body>
> </html>
> EOF
OK Thanx for the Bash tips... This is a config file:
ROOTDIR="/home/max/Development/current/website/sites/www.maccusfoto.nl/photo"
SUBDIR="travel/spain"
DIRLEVEL="2"
GENERAL_TITLE="Spain"
PAGES="47"
STARTPAGE="travel"
IMG_ALT="© Maxim Heijndijk"
CAPTION_01="MONTSERRAT"
CAPTION_02="MONTSERRAT - Wedding"
CAPTION_03=""MONTSERRAT
CAPTION_04="BARCELONA - Tibidabo"
CAPTION_05="EL MASNOU - Fireworks, Ple de Riure del Masnou"
CAPTION_06="EL MASNOU"
Navigation:
[Reply to this message]
|