#!/usr/local/bin/bash # Author M.S.Martin (Johns Hopkins) Feb 2004 # This script takes the following arguments: # - PROCESS_NAME # - PASSNAME # - filename with runlist in. # - filename with a table list in. (assumed to be in present dir) # NOTE : Max number of tables in tablelist is 10. Any more just won't # show up on the output. # NOTE : Max number of runs to be encompassed at the moment is about 2000. # Should be able to make the scripts more sophisticated to handle more. # NOTE : This script was designed on fcdflnx3, and works there. The locations # of bash,perl, and the details of the cdf software all worked in Feb 2004 # The output is a formatted list of cids. Each row of the output # corresponds to a particular run (one of the input runs) given on the # left hand side. # The rest of the row are cid's for that run (which correspond to the processname # and passname given). # The cids in different collumns correspond to differnt tables as given # at the top. # SPECIAL NOTE : A run is only output if its cid's are different from those of the # previous line. So although you put 1000 runs in, you probably won't get lines out. # usage example : ./get_cid_tables.bash PAD_PHYSICS_CDF 09 runlist.txt tablelist.txt # format of run file runlist.txt : # lowrun1 higrun1 # lowrun2 higrun2 # lowrun3 higrun3 # . # . # Note1 : lowrun < higrun otherwise bad things happen. # Note2 : For best results lowrun1 < lowrun2 because the # output is filtered so that only when the cid's # change are they outputed -> Out of order meesses this up # Bottom line : An ordered list of runs with the # lowest at the top is the expected input and will # give the most useful output. # format of table file tablelist.txt # table1 # table2 # . # . # Note1 : Do not repeat tables. # Note2 : At the moment, the max number of tables is 10 due to most screens not # being wide enough to put more in. If you need more than this # run them in a separate job. # Do setups: cdf_root=`/bin/csh -f -c "echo ~cdfsoft"` . ${cdf_root}/cdf2.shrc setup cdfsoft2 development procname=$1 passname=$2 runfile=$3 tablefile=$4 file=$4 # Create sql fragment for all runs addRuns.perl -filename=$runfile > runit.sql echo @ runit $procname $passname > frag.sql #cat frag.sql sqlplus cdf_reader/reader@cdfonprd < frag.sql > /dev/null # now the output is in get_cid_tables.txt # Run the analysis perl script on this: analyse_sql.perl -filename=$tablefile