#!/bin/tcsh # # logged in as adaq on the jlabs1 machine # set nargs = $# if ( $nargs != 2 ) then echo "Please enter year and month as arguements, ie. 99 02" exit endif set year = $1 set month = $2 set year = `echo ${year} | gawk '{if($1<1900){year="0000"$1}else{year=$1};printf"%2s\n",substr(year,length(year)-1,2)}'` set month = `echo ${month} | gawk '{month="0000"$1;printf"%2s\n",substr(month,length(month)-1,2)}'` set root = "~/public_html/halog/html/" set root2 = "${year}${month}_archive" cd ${root} "rm" -rf mcilhany_* grep "Run Number:" ${root2}/${year}${month}*html > mcilhany_run01 grep "Tar=p3he,Type=Quasielastic" ${root2}/${year}${month}*html | grep -v "keyword=Start" > mcilhany_quas01 grep "Hadron u " ${root2}/${year}${month}*html > mcilhany_asym01 grep "output triggers" ${root2}/${year}${month}*html > mcilhany_stat01 grep "Electron D1" ${root2}/${year}${month}*html > mcilhany_q201 cat mcilhany_run01 mcilhany_quas01 mcilhany_asym01 mcilhany_stat01 mcilhany_q201 > mcilhany_tot01 gawk 'BEGIN{FS=","}{print $1,$2,$3,$4,$5,$6,$7}' mcilhany_tot01 > mcilhany_tot02 gawk 'BEGIN{FS=":"}{print $1,$2,$3,$4,$5,$6,$7}' mcilhany_tot02 > mcilhany_tot025 gawk 'BEGIN{FS="="}{print $1,$2,$3,$4,$5,$6,$7}' mcilhany_tot025 > mcilhany_tot03 gawk '{if($2=="Run"){print substr($1,1,12),"zr ",$4}else{print $0}}' mcilhany_tot03 > mcilhany_tot04 gawk '{if($2=="Tar"){print substr($1,1,12),"t ",$7}else{print $0}}' mcilhany_tot04 > mcilhany_tot05 gawk '{if($2=="Hadron"){print substr($1,1,12),"h ",$5,$7}else{print $0}}' mcilhany_tot05 > mcilhany_tot06 gawk '{if($2=="Total"){print substr($1,1,12),"s ",$7}else{print $0}}' mcilhany_tot06 > mcilhany_tot065 gawk '{if($2=="Electron"){print substr($1,1,12),"s ",$7}else{print $0}}' mcilhany_tot065 > mcilhany_tot067 sort +0 -1 +1 -2 mcilhany_tot067 > mcilhany_tot07 gawk '{if($2=="zr"){if(cntr==2){print $0,last0,last00};cntr=0}else{cntr++};last00=last0;last0=$0}' mcilhany_tot07 > mcilhany_tot08 gawk '{print substr($3,length($3)-2,3),$5,$6,$8,$9,$10}' mcilhany_tot08 > mcilhany_tot09 sort +0 -1 +1 -2 mcilhany_tot09 > mcilhany_tot10 gawk '{if($1==last1){print $1,$3,$5,last3,last5,last6};last3=$3;last5=$5;last6=$6;last1=$1}' mcilhany_tot10 > mcilhany_tot11 gawk '$1>600{tote+=$3;totqe+=$4;print $0,tote,totqe}' mcilhany_tot11 > mcilhany_tot12