The R Project SVN R

Rev

Rev 7217 | Rev 7357 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2195 hornik 1
#!/bin/sh
2
#
4580 hornik 3
# ${R_HOME}/bin/BATCH
2195 hornik 4
 
7218 hornik 5
REVISION='$Revision: 1.6 $'
7217 hornik 6
VERSION=`set - ${REVISION}; echo ${2}`
7
USAGE_MSG="Usage: R BATCH [options] infile [outfile]"
8
 
2510 maechler 9
OPTS="--restore --save --no-readline"
2195 hornik 10
 
11
while test -n "${1}"; do
7217 hornik 12
  case ${1} in
13
    -h|--help|-\?)
14
      echo "${USAGE_MSG}"; exit 0 ;;
15
    -V|--version)
16
      echo "${VERSION}"; exit 0 ;;
17
    --) shift; break ;;
18
    --vsize|--nsize|-v|-n)
19
      OPTS="${OPTS} ${1} ${2}"; shift 2 ;;
20
    -*) OPTS="${OPTS} ${1}"; shift ;;
21
    *)  break ;;
22
  esac
2195 hornik 23
done
24
 
25
IN=${1}
26
OUT=${2-`basename ${1} .R`.Rout}
27
 
2510 maechler 28
(echo "invisible(options(echo = TRUE))"
29
 cat ${IN}
30
 echo "proc.time()"
4580 hornik 31
) | ${R_HOME}/bin/R ${OPTS} >${OUT} 2>&1
7218 hornik 32
 
33
### Local Variables: ***
34
### mode: sh ***
35
### sh-indentation: 2 ***
36
### End: ***