Rev 7357 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
#!/bin/sh## ${R_HOME}/bin/BATCHrevision='$Revision: 1.7 $'version=`set - ${revision}; echo ${2}`version="R batch front end ${version}"usage="Usage: R BATCH [options] infile [outfile]Run R non-interactively with input from infile and place output (stdoutand stderr) to another file. If not given, the name of the output fileis the one of the input file, with a possible \`.R' extension stripped,and \`.Rout' appended.Options:-h, --help print short help message and exit-v, --version print version info and exit-- end processing of optionsFurther arguments starting with a \`-' are considered as options as longas \`--' was not encountered, and are passed on to the R process, whichby default is started with \`--restore --save --no-readline'.Report bugs to <R-bugs@lists.r-project.org>."opts="--restore --save --no-readline"while test -n "${1}"; docase ${1} in-h|--help)echo "${usage}"; exit 0 ;;-v|--version)echo "${version}"; exit 0 ;;--vsize|--nsize)# Deprecated ...opts="${opts} ${1}=${2}"; shift 2 ;;--) shift; break ;;-*) opts="${opts} ${1}"; shift ;;*) break ;;esacdonein=${1}out=${2-`basename ${1} .R`.Rout}(echo "invisible(options(echo = TRUE))"cat ${in}echo "proc.time()") | ${R_HOME}/bin/R ${opts} >${out} 2>&1### Local Variables: ***### mode: sh ***### sh-indentation: 2 ***### End: ***