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

[REBOL] Re: Windows Information Passing (pipe into REBOL standard input)

From: michal::kracik::net at: 30-Aug-2001 22:34

Hi, this was discussed here some time ago. Pipe on the command line works in Windows 95, NT 4 and 2000 as shown in the following example, but Windows 98 prints a cryptic error message "Intermediate file error during pipe", I could not find the cause of this. command.com in both Windows 95 and 98 internally implements the | semantics with temporary files in %TEMP%, but "cmd.exe" in NT or 2000 uses real pipes. Since you mention "ipconfig /all", you probably have NT or 2000 so it should work. The important thing is that piping input into REBOL works only when output is piped to some command as well. AFAIK there are no "no-op filters" in Windows like UNIX "cat" or "tee", but I discovered that "more" can be used if REBOL output is less than a page of text, or better "findstr ." in Windows NT or 2000. The example (paste into the command line as one line, including the trailing dot): Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\>ipconfig /all | rebol.exe -wq --do "print {REBOL from stdin: } while [ line: pick system/ports/input 1 ] [ print line ] quit" | findstr . REBOL from stdin: Windows 2000 IP Configuration Host Name . . . . . . . . . . . . : neco Primary DNS Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Broadcast IP Routing Enabled. . . . . . . . : Yes WINS Proxy Enabled. . . . . . . . : No Ethernet adapter VMWare: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter (basic host-only support for VMnet1) Physical Address. . . . . . . . . : 00-50-56-D6-6A-6D DHCP Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 192.168.22.1 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : DNS Servers . . . . . . . . . . . : Hope this helps, Michal Kracik