I have the following bash script, from what I understand >> is used to append the output of a command to an existing file instead of overwrite, but what is it doing in this case? This script is calling some exe files to convert from one format to another. There are many years for each file, so it loops through each file by looking at the filename. Also when I run this script I get "ambiguous redirect"
#!/bin/bash
source $HOME/.bashrc
jobout=${1}
joberr=${2}
# Set some paths and prefixes
yr_bgn=2000
yr_end=2000
yr=${yr_bgn}
pth_data='/mnt/'
pth_rst='/mnt/'
while [ ${yr} -le ${yr_end} ]
do
./executable1 ${pth_data}file${yr}-${yr}.nc ${yr} ${pth_rst} 1>> ${jobout} 2>> ${joberr}
./executable2 ${pth_data}file${yr}-${yr}.nc ${yr} ${pth_rst} 1>> ${jobout} 2>> ${joberr}
./executable3 ${pth_data}file${yr}-${yr}.nc ${yr} ${pth_rst} 1>> ${jobout} 2>> ${joberr}
let yr=${yr}+1
done