#!/bin/tcsh -f #(ie run the cshell on this but don't read the .cshrc) echo version = 1.16 of program 2011 Mar 09 # 2011 Mar 09, 1.16: detect 'program'.p only at start of line # 2010 Oct 19, 1.15: clean up for Mac OS X # 2008 Nov 15, 1.14: gpcc-atchange-mac # 2008 Sep 17, 1.13: crash -> gpcc-atchange # 2008 Sep 17, 1.12: standardize to use environmental DELILA variables # 2007 Jun 14, 1.11: correct link to crash source script # 2007 Mar 17, 1.10: explain actions taken better # 2005 May 26, 1.09: strip .p off name if needed # 2004 Sep 17, 1.08: create automate even if program is there # 2004 Sep 10, 1.05: upgrade documentation # 2003 Aug 22, 1.05: protections for parameter files that exist # 2001 Aug 4, 1.04: updated # 1997 Mar 16, 1.00: origin 1997Mar16.13:53:08 if !($#argv == 1) then echo 'usage: program [name]' echo "Create a new delila program called 'name.p'" echo "using the shell.p as a start point." echo "It will also generate an initial parameter file, namep" echo "Three environmental files are needed." echo echo "Location of example program:" echo '$DELILA_DELILA/shell.p' echo echo "Location of sample parameter file:" echo '$DELILA_DELILA/shellp' echo echo "Scripts for handling compliler gpcc-atchange:" echo '$DELILA_SCRIPT/gpcc-atchange' echo '$DELILA_SCRIPT/gpcc-atchange-mac' exit endif # location of example program set shell = $DELILA_DELILA/shell.p # location of sample parameter file set shellp = $DELILA_DELILA/shellp # script for handling compliler gpcc-atchange # 2010 Oct 20: no longer system dependent! # set os = `uname` # if ($os == SunOS) then # set gpccatchange = $DELILA_SCRIPT/gpcc-atchange # else # set gpccatchange = $DELILA_SCRIPT/gpcc-atchange-mac # endif set gpccatchange = $DELILA_SCRIPT/gpcc-atchange set basename = `echo $1|sed "s/\.p//"` set program = ${basename}.p echo -n "Attempt to create a new program $program" echo " and parameter file ${basename}p" if !(-f $program) then echo -n "ACTION: program ${basename}.p does not exist in this directory," echo " making a starter" cat $shell |\ sed -e "s/shell/${basename}/g" |\ cat > $program if !(-f ${basename}p) then echo "ACTION: parameter ${basename}p does not exist in this directory," echo " making a starter" cat $shellp |\ sed -e "s/shell/${basename}/g" |\ cat > ${basename}p else echo ${basename}p already exists in this directory: no change endif else echo ${basename}.p exists already in this directory: no change endif if !(-f automate) then echo "ACTION: creating new automate file" touch automate endif # grep ${basename}.p automate | head -1 if (`tr ' ' '\n' < automate|grep "^${basename}.p" | head -1` == '') then echo "ACTION: Adding ${basename}.p to automate file" cat $gpccatchange |\ sed -e "s/zzz/${basename}/g" |\ cat >> automate else echo "${basename}.p is already mentioned in the automate file - no action" endif