#!/usr/local/bin/perl # Bo Milvang-Jensen (milvang@astro.ku.dk) # For the RelViz Web exhibition, June 1996 # Last rev.: 17-Jun-1996 require '/usr/local/etc/httpd/cgi-bin/cgi-lib.pl'; # Read and pars (sic!) &ReadParse; # Extract variables from $in : $M = $in{'M'}; $a_over_M = $in{'a_over_M'}; $r = $in{'r'}; $th = $in{'th'}; $ph = $in{'ph'}; $t = $in{'t'}; $dr = $in{'dr'}; $dth = $in{'dth'}; $dph = $in{'dph'}; $dl = $in{'dl'}; $nl = $in{'nl'}; $scene_format = $in{'scene_format'}; $pointset = $in{'pointset'}; $cr = $in{'cr'}; $cg = $in{'cg'}; $cb = $in{'cb'}; $coo = $in{'coo'}; $coo_length = $in{'coo_length'}; $labelx = $in{'labelx'}; $horizon = $in{'horizon'}; $auto_radius = $in{'auto_radius'}; $manual_radius = $in{'manual_radius'}; $hcr = $in{'hcr'}; $hcg = $in{'hcg'}; $hcb = $in{'hcb'}; $transp = $in{'transp'}; $make_r_stat = $in{'make_r_stat'}; $scr = $in{'scr'}; $scg = $in{'scg'}; $scb = $in{'scb'}; # Construct random filenames for csh script and IDL output srand (time^$$); $zzz = rand; $csh_file = "/tmp/milvang_csh_$zzz"; ###This print line should not be there, see mail to csp dated 10-Apr-2001 /BMJ ###print "The C-shell script is ", $csh_file, "

\n"; $out_file = "/tmp/milvang_out_$zzz"; # Make csh script: open(FILE, "> $csh_file"); print FILE <<"PRINTEND2"; #!/bin/csh # Bo Milvang-Jensen (milvang\@astro.ku.dk) # For the RelViz Web exhibition, June 1996 # Last rev.: 07-Jun-1996 # Notes: # 1) The IDL procedures should be located within $IDL_PATH # 2) The quotes around the label (EOF) gives no shell # expansions, # so things like !pi are passed correctly on to IDL # 3) If STDOUT/STDERR from IDL is not redirected, it will end up in # /usr/local/etc/httpd/logs/error_log setenv IDL_PATH /l/RelViz/WWW/milvang/idl:+/usr/local/rsi/idl/lib /usr/local/scripts/idl << 'EOF' >>& /dev/null #/usr/local/scripts/idl << 'EOF' >>& /tmp/idl_out script1, $M, $a_over_M, $r, $th, $ph, $t, $dr, $dth, $dph, $dl, $nl, \$ "$scene_format", $pointset, $cr, $cg, $cb, "$coo", $coo_length, \$ "$horizon", "$auto_radius", $manual_radius, \$ $hcr, $hcg, $hcb, $transp, "$make_r_stat", $scr, $scg, $scb, \$ "$out_file", labelx=$labelx 'EOF' PRINTEND2 close(FILE); # Set execute permission: system "chmod +x $csh_file"; # Run csh script: system ("$csh_file"); # Delete csh script: system ("/bin/rm $csh_file"); # Set MIME type: if ($scene_format eq "Inventor") { $MIME_type = "application/x-inventor"; } else { if ($scene_format eq "VRML") { $MIME_type = "x-world/x-vrml"; } else { $MIME_type = "text/plain"; } } # Return IDL output to the Web user: print "Content-type: $MIME_type\n\n"; print `cat $out_file`; # Delete IDL output file: system ("/bin/rm $out_file");