I am layman to unix and sofar I using R in windows. For example I type following in my R session (in R gui).
# this is a my funny example script
X <- 1:
If your program is going to work on a single dataset, then simple-r might be the solution:
http://code.google.com/p/simple-r/
It is especially designed for simple statistical analysis as a part of Linux command line. For example, if one wants to plot some data, 'r -p data.txt' will do the job; for getting correlation coefficient: 'r cor data.txt' will suffice.