If you're running an R script from bash, you can loop over it with:
array=(JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC)
for f in {0..11}
do sed "s/JAN/"${array[f]}"/g" script.R > script_"$f".R
Rscript --vanilla script_"$f".R
done
This keeps each individual script (one per month named script_0.R / script_1.R / etc) in case a run fails and you need to rerun it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…