Hi,

actually, pipe can be used for redirecting REBOL input and output in
Windows. The problem is that Windows does not have the cat command,
and few other commands support input from stdin. You can try this in
Windows command prompt in all Windows versions:

C:\REBOL\test>rebol -wq --do "print {Hello World} quit" | more
Hello World

or this in Windows NT and 2000:
C:\REBOL\test>rebol -wq --do "print {Hello World} quit" | findstr .
Hello World

What surprised me, piping input into REBOL works as well, if output
is also redirected:

C:\REBOL\test>echo "Hello REBOL" | rebol -wq --do "print [ {from stdin:}
input ] quit" | more
from stdin: "Hello REBOL"

Regards,
Michal Kracik

Brian Hawley wrote:
> 
> 2ker wrote:
> >Is this possible to catch data from stdin with REBOL/Core?
> >(something like: cat file.txt |rebol -w script.r )
> >Does it require /Command or /View/Pro (shell extension)?
> 
> It depends on whether you're running Windows or something
> more Unix-like. On Unix-like systems, I/O redirection is
> done without difficulties. On Windows the | operator does
> not work with REBOL, just > and <.
> 
> You can do full I/O redirection from within REBOL with the
> shell functions of /Command and /Pro, but in REBOL syntax.
> See the docs on the shell functions on the REBOL site, but
> before you ask: No, you can't use the | operator with /Pro
> or /Command on Windows either.
> 
> My advise: Get /Pro and use REBOL scripts as the main glue
> to call all of the external programs, instead of DOS batch
> language (useless) or Perl (ugly) :)
> 
> Brian Hawley
> 
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to