Execution of R program as a bash script

Here is a simple example of bash script which executes R code within. Create a file called R.sh with the following content:

#!/bin/bash
R –no-save rfunction(2,5)
[1] 7
>