/
Rcmd
executable file
·50 lines (41 loc) · 909 Bytes
/
Rcmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/sh
#
# ${R_HOME}/bin/Rcmd
## Shell script wrapper for all R CMD commands.
## For internal use only.
R_CMD="${R_HOME}/bin/Rcmd"
export R_CMD
R_OSTYPE="unix"
export R_OSTYPE
## Add 'share/perl' to the perl library path.
if test -n "${PERL5LIB}"; then
PERL5LIB="${R_HOME}/share/perl:${PERL5LIB}"
export PERL5LIB
else
PERLLIB="${R_HOME}/share/perl:${PERLLIB}"
export PERLLIB
fi
## Add 'share/texmf' to TeX's input search path.
TEXINPUTS=".:${R_HOME}/share/texmf:${TEXINPUTS}"
export TEXINPUTS
. ${R_HOME}/etc/Renviron
export `sed 's/^ *#.*//; s/^\(.*\)=.*/\1/' ${R_HOME}/etc/Renviron`
case "${1}" in
perl)
cmd="${PERL}" ;;
awk)
cmd="${AWK}" ;;
*)
if test -x "${R_HOME}/bin/${1}"; then
cmd="${R_HOME}/bin/${1}"
else
cmd="${1}"
fi
;;
esac
shift
exec "${cmd}" "${@}"
### Local Variables: ***
### mode: sh ***
### sh-indentation: 2 ***
### End: ***