Re: [R] --no-save and --save toggle from inside R? + BATCH stderr

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Wed 12 Jul 2006 - 00:41:03 EST

This sort of thing is contrary to the Unix spirit. It gives the user no choice but to be told that there is a non-zero error code, whereas it is really easy for the user to wrap the command in his/her own script that reports the error code in whatever form is desired.

The Unix idea is to think about combining things from your toolkit, not complicate the tools with endless options (and this would have to be made optional as I for one don't want it).

Assuming you are concerned with user errors and not those deep in R, you can use R's own error-handling system to set the error status anyway, and report as wanted.

On Tue, 11 Jul 2006, Duncan Murdoch wrote:

> ivo welch wrote:
> > the following diff to the shell script invoking R prints an error
> > message if R terminates with an error code:
> >
> > 112c112,119
> > < exec sh "${R_HOME}/bin/Rcmd" "${@}" ;;
> > ---
> >
> >> sh "${R_HOME}/bin/Rcmd" "${@}"
> >> rc="$?"
> >> if [ "$rc" -ne 0 ]; then
> >> shift ;
> >> echo "${@}: Error Return Code: $rc"
> >> fi
> >> exit $?
> >> ;;
> >>
> This looks to me like a good suggestion, but I generally don't make
> modifications to platform-specific things on platforms I don't use, so
> I'd suggest posting this to R-devel or on the bug list as a wishlist
> item. Otherwise it might get lost.
>
>
> Duncan Murdoch
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Jul 12 00:53:51 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 12 Jul 2006 - 02:19:55 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.