The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2160 hornik 1
#!/bin/sh
2
#
4580 hornik 3
# ${R_HOME}/bin/help
2160 hornik 4
 
7218 hornik 5
if [ "${1}" = "INDEX" ]; then
2160 hornik 6
    subject=${2}
7
    shift 2
3609 pd 8
    for index in ${*}
2160 hornik 9
    do
10
	if [ -f ${index} ];
11
	then
12
	    file=`grep "^${subject}	" ${index} | cut -f 2`
13
	    if test -n "${file}"
14
	    then
15
		echo `dirname ${index}`/${file}
16
		exit 0
17
	    fi
18
	fi
19
    done    
20
    echo
7218 hornik 21
elif [ "${1}" = "PRINT" ]; then
3786 pd 22
    LATEX=${4}
2160 hornik 23
    if [ "${LATEX}" = "false" ];
24
    then
25
	echo "Cannot print, latex seems to be unavailable"
26
	exit 1
27
    fi
3786 pd 28
    DVIPS=${5}
2160 hornik 29
    if [ "${DVIPS}" = "false" ];
30
    then
31
	echo "Cannot print, dvips seems to be unavailable"
32
	exit 2
33
    fi
34
    shift
35
    ODIR=`pwd`
36
    cd `dirname ${1}`
3609 pd 37
    ${LATEX} "\\nonstopmode\\input{${1}}" >/dev/null 2>&1
2160 hornik 38
    ${DVIPS} ${1} 2>/dev/null
39
    if test -f ${1}.ps;
40
    then
3609 pd 41
        echo "Saving help page to \`${2}.ps'"
2160 hornik 42
        mv ${1}.ps ${ODIR}/${2}.ps
43
    fi
4010 ripley 44
    rm -f ${1}.aux ${1}.dvi ${1}.log
2160 hornik 45
fi
7218 hornik 46
 
47
### Local Variables: ***
48
### mode: sh ***
49
### sh-indentation: 2 ***
50
### End: ***