This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Robert, the most likely problem is that the www user may not have permision to create the last.nts and gemglb.nts files in its work directory, or if you have run the script to test it out, then maybe the ownership of the files is by you ... preventing the web user from writing over them. I put together a really quick test here at: http://www.unidata.ucar.edu/staff/chiz/stations/mos.html This just uses a server side include rather than cgi, but the theory should be the same. the www page above looks like: <html> <TITLE>mos test</TITLE> <body bgcolor=ffffff> <b>DEN mos<b> <p> <pre> <font color=#800000> <!--#exec cmd="/export/dist/htdocs/staff/chiz/stations/mosupdate.csh den"--> </font> </pre> <P> This page maintained by: <A HREF="/staff/chiz"> <address>address@hidden</address></A> </body> </html> The script being executed (eg mosupdate.csh accepts the station on the command line similar to what you would pass from your cgi handler). The script looks like: #!/bin/csh -f setenv PATH /bin:/usr/bin:.:/sbin:/etc:/usr/local/bin source /home/gempak/Gemenviron if($#argv != 1) then echo "Usage: mosupdate.csh file" exit endif # create a temporary work directory set WORK=/tmp/.mostext.$$ mkdir $WORK cd $WORK sflist << EOF >& /dev/null SFFILE = $GEMDATA/mos/99032412_nmos.gem sfparm = text out = f/mos_${1} idntyp = stid dattim = all area = @${1} r e EOF cat mos_${1} # cleanup rm mos_${1} rm last.nts rm gemglb.nts cd .. rmdir $WORK:t exit To ensure I have a directory that the www user "nobody" can write its .nts files into, I created a working directory in /tmp using the process id, and cleaned it up after finishing. You can test out the pages mentioned above. Hope this helps. Steve Chiswell Unidata User Support >From: Robert Mullenax <address@hidden> >Organization: . >Keywords: 199903242109.OAA28221 >Steve , > >Here is the problem I am having. I have had no trouble running these type >scripts using Bourne shell >and McIDAS(simple text output). I am using uncgi and inputting station >selection from the browser( >"sta) hence $WWW_sta in uncgi terms. Here is what I try to do as cgi script > >#!/bin/csh -f >source /export/home/gempak/NAWIPS-5.4/Gemenviron ># ># >echo Content-type: text/plain >echo "" >sflist << EOF >SFFILE = $GEMDATA/mos/99032412_nmos.gem >AREA = @$WWW_sta >DATTIM = all >SFPARM = text >OUTPUT = t >IDNTYP = stid >r > >e >EOF > >When running this there is no output, it just does not respond. If I switch t > o >Bourne shell, >and put in the McIDAS environment and then do something like: > >mcenv << EOF >fousrpt.k $WWW_sta > >EOF > >everything works fine. > >If I run the Gempak script from the command line as seen below it works fine. > >Any help would be greatly appreciated. > >Robert Mullenax > > > >Script named mosgem2 run from command line: >#!/bin/csh -f >source /export/home/gempak/NAWIPS-5.4/Gemenviron ># > >set WWW_sta=FAI > ># >echo Content-type: text/plain >echo "" >sflist << EOF >SFFILE = $GEMDATA/mos/99032412_nmos.gem >AREA = @$WWW_sta >DATTIM = all >SFPARM = text >OUTPUT = t >IDNTYP = stid >r > >e >EOF > >