On 21 April 2007 at 09:16, ivo welch wrote:
| I spoke to soon.  cat("hello", file=stderr()) does not "punch through"
| R CMD BATCH test.R.  Is there a way to have stderr() messages escape
| the log and go directly to the invoking terminal (i.e., under
| linux/unix, late-release gentoo).  Maybe this should require a
| different name than "BATCH", so as to not break scripts that rely on
| nothing escaping.  I find it very convenient in long scripts written
| in perl or C to have the ability to write "blips" to the terminal,
| too...

Works for me using our 'little r' aka littler tool:

[EMAIL PROTECTED]:~> r -e 'cat("Hello stderr\n", file=stderr()); cat("Hello 
stdout\n")' > /tmp/ivo.txt
Hello stderr
[EMAIL PROTECTED]:~> cat /tmp/ivo.txt
Hello stdout
[EMAIL PROTECTED]:~> 

So capture stdout as one commonly does, yet stderr comes through for alerts.

Dirk

-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to