#!/bin/sh run_number=$1 bare_number=$1 type=$2_$run_number name=$2 scat_num=$3 home=$HOME/espace hbook_dir=$HOME/espace/hbook expnum=e93050 # ####Write file espace_batch_#### # echo '#!/bin/sh' > espace_batch_$type echo '/work/halla/software/bin/SunOS/espace_fpp 2>error_'$type' >output_'$type' << EOF' >> espace_batch_$type echo 'exec fpp_'$name' batch=on scat_num='$scat_num' nrun='$bare_number >> espace_batch_$type echo 'EOF' >> espace_batch_$type echo 'cp '$expnum'_'$run_number'.dat.cuts '$home'/' >> espace_batch_$type echo 'cp '$expnum'_'$run_number'.dat.scal '$home'/' >> espace_batch_$type echo 'cp error_'$type $home'/' >> espace_batch_$type echo 'cp output_'$type $home'/' >> espace_batch_$type echo 'cp fpp_'$type'.hbook.kumac ' $hbook_dir >> espace_batch_$type echo 'cp fpp_'$type'.hbook ' $hbook_dir >> espace_batch_$type chmod a+x espace_batch_$type # ### Write the jsub command file # echo 'PROJECT: halla_'$expnum > jsub_file_$type echo 'JOBNAME: espace_'$type >> jsub_file_$type echo 'COMMAND: '$home'/espace_batch_'$type >>jsub_file_$type echo 'OS: solaris' >>jsub_file_$type echo 'OTHER_FILES:' >>jsub_file_$type echo $home'/fpp_alignment_matrix_front.dat '$home'/fpp_alignment_matrix_rear.dat '$home'/fpp_demux_cuts.dat '$home'/fpp_drift_dist_fits.dat '$home'/detmap.config '$home'/hdr_scat_'$scat_num $home'/db_e2000_h1000 '$home'/espace_kumac/fpp_'$name'.kumac '$home'/fpp_toffset_crude.calib '$home'/fpp_toffset_ref.calib '$home'/emiss_pmiss_elas.dat ' >> jsub_file_$type echo 'INPUT_FILES:/mss/halla/'$expnum'/raw/'$expnum'_'$run_number'.dat' >>jsub_file_$type echo 'INPUT_DATA: '$expnum'_'$run_number'.dat' >> jsub_file_$type # #Submit job to farms # jsub jsub_file_$type