sunpath script error

Hello all-

I have been working on the (excellent) daylight analysis
chapter in "Rendering With Radiance" (chapter six). I am
attempting to use the sunpath shell script, but keep
getting this error:

^ unexpected character
oconv: system - cannot open scene file "sky.rad": No such
file or directory
Usage: pcompos [-x xr][-y yr][-b r g b][-a n][-s p][-o x0
y0][-la][-lh h] [-t min1][+t max1][-l lab][=SS] pic1 x1 y1 ..
rpict: fatal - command line error at '-av'
rpict: 0 rays, 0.00% after 0.000u 0.000s 0.000r hours on
pfilt: bad picture size

Being a newbie with not only Radiance but also UNIX, I'm
wearing out a spot on my head where I keep scratching
it. It appears that the $skypar variable is not getting
populated correctly; oconv then fails to create the
daylight component of the model (sky.rad), and
everything falls apart from there.
I have looked at this for some time, but I know it's easy
to miss mistakes in code especially when you don't fully
understand all the nuances of the commands yet. Could
someone here spot the error of my ways? I have pasted
the script below (some of the long lines may wrap, but
compare them to what's in the book -- sorry, I forget
what page it's on but it's in chapter 6).

BTW, I'm running this on OS X, using the pre-compiled
binaries from Greg Ward. (thanks Greg!)

#!/bin/csh -f
set mon = 06
set month = June
set day = 21
set coord = ( -a 42.3 -o 71.1 -m 75)
set ab = 2
set ad = 512
set as = 128
set ar = 64
set aa = 0.3
foreach hr (09 10 11)
set skypar = ($mon $day $hr +i $coord)
set gambv = `gensky $skypar | rcalc -i '# Ground
ambient\ level: ${ga}' -e '$1=ga'`
if ($gambv == 0) goto SKYDARK
set inamb = `rcalc -n -e '$1='"$gambv"'/2'`
set inamb = ($inamb $inamb $inamb)
set ambpar = (-ab $ab -ad $ad -as $as -ar $ar -aa $aa -
av $inamb)
oconv -i room.oct '\!gensky '"$skypar" sky.rad > hr.oct
rpict -vf 1.vf $ambpar \
-x 1024 -y 1024 hr.oct \

pfilt -1 -e 0.06 -x /3 -y /3 \
pcompos -0 0 '\!psign '"$month"' '"$day"' '"$hr"'h00' 0 0

rm hr.oct


Rob Guglielmetti <[email protected]>

The problem seems to come from the \ sign that appears at line:

set gambv = `gensky $skypar | rcalc -i '# Ground ambient\ level: ${ga}' -e '$1=ga'`

Just replace this line by:

set gambv = `gensky $skypar | rcalc -i '# Ground ambient level: ${ga}' -e '$1=ga'`

and the script should work now...