#!/bin/bash # script to be executed in the pyrate directory config_file=/g/data/dg9/INSAR_ANALYSIS/CAMDEN/RSAT2/GAMMA/T081D/pyrate/input_parameters_camden.conf # Orbit correction multilooking #parameter="orbfitlks" #parameter1="orbfitlksx" #parameter2="orbfitlksy" #declare -a datalist=("2" "4" "8") parameter1="orbfitmethod" parameter2="orbfitdegrees" declare -a datalist1=("1" "2") declare -a datalist2=("1" "2" "3") for value in ${datalist1[@]}; do # edit config file - orbitfitmethod line=`grep ^$parameter1 $config_file` newline=$parameter1": "$value echo "$newline" sed -i "s/$line/$newline/g" $config_file # second for loop for second parameter for value in ${datalist2[@]}; do # edit config file - orbitfitdegrees line=`grep ^$parameter2 $config_file` newline=$parameter2": "$value echo "$newline" sed -i "s/$line/$newline/g" $config_file # run PyRate mpirun -n 16 pyrate -v INFO correct -f $config_file done done