The R Project SVN R

Rev

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

Rev 20002 Rev 27143
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='$Revision: 1.12 $'
5
revision='$Revision: 1.13 $'
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 The R Core Development Team.
9
Copyright (C) 2000--2003 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
11
or later for copying conditions.  There is NO warranty."
11
or later for copying conditions.  There is NO warranty."
12
 
12
 
-
 
13
opts="--restore --save --no-readline --gui=none"
-
 
14
 
13
usage="Usage: R CMD BATCH [options] infile [outfile]
15
usage="Usage: R CMD BATCH [options] infile [outfile]
14
 
16
 
15
Run R non-interactively with input from infile and place output (stdout
17
Run R non-interactively with input from infile and place output (stdout
16
and stderr) to another file.  If not given, the name of the output file
18
and stderr) to another file.  If not given, the name of the output file
17
is the one of the input file, with a possible '.R' extension stripped,
19
is the one of the input file, with a possible '.R' extension stripped,
Line 22... Line 24...
22
  -v, --version		print version info and exit
24
  -v, --version		print version info and exit
23
  --			end processing of options
25
  --			end processing of options
24
 
26
 
25
Further arguments starting with a '-' are considered as options as long
27
Further arguments starting with a '-' are considered as options as long
26
as '--' was not encountered, and are passed on to the R process, which
28
as '--' was not encountered, and are passed on to the R process, which
27
by default is started with '--restore --save --no-readline'.
29
by default is started with '$opts'.
-
 
30
See also help(BATCH) inside R;
28
 
31
 
29
Report bugs to <r-bugs@r-project.org>."
32
Report bugs to <r-bugs@r-project.org>."
30
 
33
 
31
opts="--restore --save --no-readline --gui=none"
-
 
32
 
-
 
33
while test -n "${1}"; do
34
while test -n "${1}"; do
34
  case ${1} in
35
  case ${1} in
35
    -h|--help)
36
    -h|--help)
36
      echo "${usage}"; exit 0 ;;
37
      echo "${usage}"; exit 0 ;;
37
    -v|--version)
38
    -v|--version)
38
      echo "${version}"; exit 0 ;;
39
      echo "${version}"; exit 0 ;;
39
    --min-vsize|--min-nsize|--max-vsize|--max-nsize|--vsize|--nsize)
40
    --min-vsize|--min-nsize|--max-vsize|--max-nsize|--vsize|--nsize)
40
      # Deprecated ...
41
      # Deprecated (hence not documented)...
41
      opts="${opts} ${1}=${2}"; shift 2 ;;
42
      opts="${opts} ${1}=${2}"; shift 2 ;;
42
    --) shift; break ;;
43
    --) shift; break ;;
43
    -*) opts="${opts} ${1}"; shift ;;
44
    -*) opts="${opts} ${1}"; shift ;;
44
    *)  break ;;
45
    *)  break ;;
45
  esac
46
  esac