Dear all,<br><br>I guess that it is not the right place to ask this question, but I know that it can be solved here that's why I'm asking...<br>In Windows, in order to make a time series data, I use .bat file which name is run_script.bat and which contains:<br>
<br>foreach m (1 2 3 4 5 6 7 8 9 10 11 12)<br>ncdump fpar_re_2001_$(m).nc > test.cdl<br>sed -n '1,1p' test.cdl > test1.cdl<br>cat header_fpar_re_2001.txt >> test1.cdl<br>echo "" >> test1.cdl<br>
echo "data:" >> test1.cdl<br>echo "" >> test1.cdl<br>echo " time = $(m) ; " >> test1.cdl<br>echo "" >> test1.cdl<br>sed -n '16,20000000p' test.cdl >> test1.cdl<br>
ncgen -o fpar_re_fnl_2001_$(m).nc test1.cdl<br>end<br><br>and I use command prompt to run it:<br><br>tcsh run_script.bat<br><br>and it works perfectly.<br><br><br>Now, I move to Mac OS X and try to run this script. I did:<br>
<br>csh run_script.bat<br><br>but always get an error: "foreach: Words not parenthesized."<br>I have already changed the $(m) to ${m} and even type directly the name
of the file but always obtain the message "foreach: Words not
parenthesized."<br>I changed the extension to .sh but always the same problem.<br><br>Any help would be very helpful.<br><br>Thank you,<br><br>Serge<br><br>