I am trying to submit a job to be executed on cluster. And this is done by writing an sbatch submission script. The job involves opening R 3.1.3 and running the referenced R script on the server.Here is the shell script I wrote:#!/bin/bash#SBATCH --account=810639#SBATCH --time=1200#SBATCH --mem-per-cpu=4096#SBATCH --ntasks=1#SBATCH --constraint=normalmem#SBATCH --output=output_%j.txt#SBATCH --error=error_output_%j.txt#SBATCH --job-name=AggrigatePIXEL#SBATCH --partition=ESG_Std#SBATCH --mail-type=FAIL#SBATCH --mail-user=tewodros.yate@wur.nl# print date and timemodule load R/3.1.3module load geos/gcc/64/3.4.2module load netcdf/gcc/64/4.3.3module load gdal/gcc/64/1.11.1source('AggrigatePIXEL_Forecast_easyVerfication_SERVERversion.R')When I try to run the shell script (saved as yate.sh) it gives me the following error message:./yate.sh: line 20: syntax error near unexpected token'AggrigatePIXEL_Forecast_easyVerfication_SERVERversion.R'./yate.sh: line 20: source('AggrigatePIXEL_Forecast_easyVerfication_SERVERversion.R')I know the problem is related to opening and executing the .R script which requires running the R program first. Can anybody help me on how I can instruct this in the shell script?
How to execute R script attaching it to a shell script in Linux?
shell script;r