Hello All, I'm trying to supply both an expression and a .R file to Rscript. But it seems that it is not possible with the first approach (see below) and I'll have to use the second approach (see below). I'm wondering if it is a bug in Rscript not to support both a .R file and an expression.
$ cat main.R x=x+3 print(x) $ cat main.sh #!/usr/bin/env bash Rscript -e 'x=10' main.R #first approach Rscript -e "x=10; source('main.R')" #second approach $ ./main.sh > x=10 > > > x=10; source('main.R') [1] 13 > > -- Tom ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.