The R Project SVN R

Rev

Rev 40416 | Rev 40621 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 40416 Rev 40417
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#
2
#
3
# ${R_HOME}/bin/BATCH
3
# ${R_HOME}/bin/BATCH
4
 
4
 
5
revision='$Rev: 40416 $'
5
revision='$Rev: 40417 $'
6
version=`set - ${revision}; echo ${2}`
6
version=`set - ${revision}; echo ${2}`
7
version="R batch front end ${version}
7
version="R batch front end ${version}
8
 
8
 
9
Copyright (C) 2000--2006 The R Core Development Team.
9
Copyright (C) 2000--2006 The R Core Development Team.
10
This is free software; see the GNU General Public Licence version 2
10
This is free software; see the GNU General Public Licence version 2
Line 44... Line 44...
44
done
44
done
45
 
45
 
46
in=${1}
46
in=${1}
47
out=${2-`basename ${1} .R`.Rout}
47
out=${2-`basename ${1} .R`.Rout}
48
 
48
 
-
 
49
tmpfile=${TMPDIR-/tmp}/R-BATCH.${$}
-
 
50
 
49
## this used to set options(echo=TRUE), but that is the default
51
## this used to set options(echo=TRUE), but that is the default
50
## except for --slave, and why inhibit the latter?
52
## except for --slave, and why inhibit the latter?
51
(cat ${in}
53
cp ${in} ${tmpfile}
52
  echo ''; echo "proc.time()"
54
(echo ''; echo "proc.time()") >> ${tmpfile}
-
 
55
 
-
 
56
## need to put -f first in case user does --args
53
) | ${R_HOME}/bin/R ${opts} ${R_BATCH_OPTIONS} >${out} 2>&1
57
${R_HOME}/bin/R -f ${tmpfile} ${opts} ${R_BATCH_OPTIONS} >${out} 2>&1
-
 
58
exitstatus=$?
-
 
59
 
-
 
60
rm -f ${tmpfile}
54
 
61
 
-
 
62
exit ${exitstatus}
55
### Local Variables: ***
63
### Local Variables: ***
56
### mode: sh ***
64
### mode: sh ***
57
### sh-indentation: 2 ***
65
### sh-indentation: 2 ***
58
### End: ***
66
### End: ***