#! /bin/csh # # Convert the Monstergauss source code "in place" to a different version. # This file saved as ~mgauss/bin/convrtvax.job. # # Usage: ~mgauss/bin/convrtvax.job >&/tmp/convrtvax.out &. # switch ("`uname`") case HP-UX: set os = hp breaksw case IRIX*: set os = sgi breaksw default: set os = UNKNOWN breaksw endsw # # Make a directory for the new source to be written to temporarily. # if (! -d /tmp/newgauss) then echo " Creating /tmp/newgauss directory." mkdir /tmp/newgauss endif if (-f /tmp/tape.job) then echo " Deleting /tmp/tape.job." rm -f /tmp/tape.job endif # cd ~mgauss/src # # Move each source file to file.sav. # echo " " echo " Moving source files to 'file.sav'." foreach file (gl*) if ("$file:e" == "sav") then echo " *** File $file already has '.sav' extension ***" if (-f $file:r) then echo " *** Confusion: file $file:r also exists ***" echo " *** Abondoning Monstergauss conversion ***" exit(1) endif else mv -i $file $file.sav endif end # # Convert each file separately. # foreach file (gl*) echo " " echo " Converting $file to $file:r." if ("$file:e" != 'sav') then echo " *** File $file does not have the '.sav' extension ***" echo " *** Abondoning Monstergauss conversion ***" exit(1) endif ~mgauss/bin/$os/convrt2 </dev/null 1,$s/ *$// wq 'EOF' # # Delete '/tmp/tape.job' which is not needed. # rm -f /tmp/tape.job # # End of loop over source files. # echo " *******************************************************************" end # # Clean up. # if (-d /tmp/newgauss) then rm -rf /tmp/newgauss endif echo " " echo " Delete file /tmp/convrtvax.out now." echo " Source files should be ready for compilation." echo " After successful compilation/testing, delete the src/gl*.sav files."