The R Project SVN R

Rev

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

Rev 40417 Rev 40621
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: 40417 $'
5
revision='$Rev: 40621 $'
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.${$}
49
R_BATCH=${$}
50
 
50
export R_BATCH
51
## 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
52
## except for --slave, and why inhibit the latter?
52
## except for --slave, and why inhibit the latter?
53
cp ${in} ${tmpfile}
-
 
54
(echo ''; echo "proc.time()") >> ${tmpfile}
-
 
55
 
53
 
56
## need to put -f first in case user does --args
54
## need to put -f first in case user does --args
57
${R_HOME}/bin/R -f ${tmpfile} ${opts} ${R_BATCH_OPTIONS} >${out} 2>&1
55
${R_HOME}/bin/R -f ${in} ${opts} ${R_BATCH_OPTIONS} >${out} 2>&1
58
exitstatus=$?
-
 
59
 
-
 
60
rm -f ${tmpfile}
-
 
61
 
56
 
62
exit ${exitstatus}
-
 
63
### Local Variables: ***
57
### Local Variables: ***
64
### mode: sh ***
58
### mode: sh ***
65
### sh-indentation: 2 ***
59
### sh-indentation: 2 ***
66
### End: ***
60
### End: ***