Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Core and stdin

From: kracik:mbox:dkm:cz at: 13-Apr-2001 20:17

Brian Hawley wrote:
> >actually, pipe can be used for redirecting REBOL input and output in > >Windows. The problem is that Windows does not have the cat command, > > If you don't have Cygwin, try the type command. > Better yet, why cat into a pipe at all? Use the < operator instead. >
Cat is needed for printing REBOL output to the console, not for piping input into REBOL. Unfortunately, type command does not accept input from stdin, more freezes after one page and waits for user input, and findstr is missing in Windows 9x. If you find some other Windows command that works like cat, let me know. I use cygwin tools, but I needed a solution that works on all Windows installations. Actually, I needed that for printing msdev output to the console, but then I discovered that it works with REBOL as well.
> ... > >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" > > That never occurred to me! I just tried it and it works. Cool! > Now I can rewrite the workarounds I've made over the years :) >
Until I tried it this morning, I also thought it was impossible :-) Now that we know it, it's clear - after all, REBOL works in CGI mode in Windows, and that requires stdin and stdout connected with pipes to the web server. -- Michal Kracik