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&#39;s why I&#39;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 &gt; test.cdl<br>sed -n &#39;1,1p&#39; test.cdl &gt; test1.cdl<br>cat header_fpar_re_2001.txt &gt;&gt; test1.cdl<br>echo &quot;&quot; &gt;&gt; test1.cdl<br>
echo &quot;data:&quot; &gt;&gt; test1.cdl<br>echo &quot;&quot; &gt;&gt; test1.cdl<br>echo &quot; time = $(m) ; &quot; &gt;&gt; test1.cdl<br>echo &quot;&quot; &gt;&gt; test1.cdl<br>sed -n &#39;16,20000000p&#39; test.cdl &gt;&gt; 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: &quot;foreach: Words not parenthesized.&quot;<br>I have already changed the $(m) to ${m} and even type directly the name 
of the file but always obtain the message &quot;foreach: Words not 
parenthesized.&quot;<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>