Skip to content
Snippets Groups Projects
scheduleScenarios.sh 653 B
Newer Older
#!/bin/sh

if [ "$#" -lt 1  ]; then
   echo "Need to specify scenario table file"
   exit
fi


filename="$1"
output_dir=/Users/peteralexander/Documents/R_Workspace/UNPLUM/dummy/scenarios/
echo "Starting scenarios in $output_dir"

while read -r datarow $filename
do
  IFS=',' read -r -a array <<< "$datarow"

  if [ -z "$header" ]; then
     header=( "${array[@]}" )
  else
     scenario="${array[0]}"
     scenario_dir=$output_dir$scenario
     echo $scenario

     if [ ! -d "$scenario_dir" ]; then
        echo "Scenario $scenario dir is missing, so skipping"
        continue;
     fi

     echo "qsub runPlum.sh scenario_dir"
  fi
done < $filename