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

Using Pipe with /Core

 [1/7] from: gjones05:mail:orion at: 29-May-2001 8:23


A while back, Michal Kracik wrote in response to a question: === 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 === I've been trying this with /Core 2.5 on Win98 at the command prompt without luck. I get an "Intermediate File Error" at the prompt. Although the lines wrap here, I was careful that it was entered as a single line. Any ideas why it worked for Michal and not for me? Thanks. --Scott Jones

 [2/7] from: brett::codeconscious::com at: 30-May-2001 0:00


Hi Scott, I just entered each case on my installation. Each one worked fine, except the last. Then I noticed a typo and it worked fine too :) Both Core 2.5 and Core 2.3 on WinNT4 I changed directory to each rebol directory and execute the line there. I'm so glad you posted this because I couldn't nut out the syntax by myself :) Regarding why it doesn't work for you - check that you have Rebol/Core on the PATH in your user environment variables - I've forgotten where that is for Win98. Also ensure you have a environment variable called REBOL_HOME pointing to the correct core directory. Lastly, is there anything in your autoexec.bat that might potentially screw Rebol up? Just throwing wild ideas around... Intermediate file error is suspicious. Have you tried doing some similar redirection with another exe? Might help the process of elimination... E.g. Assuming you have qbasic, how about creating a test.bas file with the lines input a$ print a$ system and then at the command prompt echo "testing" | qbasic/run test.bas I don't know if it will help but it is worth a try. Brett.

 [3/7] from: chris:starforge:demon at: 29-May-2001 15:14


Brett Handley wrote:
> "Intermediate file error" is suspicious. Have you tried doing some similar > redirection with another exe? Might help the process of elimination...
ISTR that the dos prompt in Win98 is very crufty. I know that file redirection is broken (foobar > log will not work for example) so it wouldn't surprise me to find out that pipes are a bit messed up too. If it stays true to Micro$oft form it'll vary from service pack to service pack as well, which may explain why some people get it to work while others don't. Chris

 [4/7] from: gjones05:mail:orion at: 29-May-2001 10:18


From: "Brett Handley"
> I just entered each case on my installation. Each one worked fine,
except
> the last. Then I noticed a typo and it worked fine too :) > > Both Core 2.5 and Core 2.3 on WinNT4 > > I changed directory to each rebol directory and execute the line
there. ...
> Regarding why it doesn't work for you - check that you have Rebol/Core
on
> the PATH in your user environment variables - I've forgotten where
that is
> for Win98. Also ensure you have a environment variable called
REBOL_HOME
> pointing to the correct core directory.
Added this to my autoexec.bat, which now reads: loadhigh C:\windows\command\doskey.com path=%path%;c:\progra~1\tclpro1.4\win32-ix86\bin set PATH="%PATH%;C:\vim\vim57" set REBOL_HOME=C:\REBOL rebooted, went to MS-DOS prompt, and change to c:\rebol then ran: C:\rebol>rebol -wq --do "print {Hello World} quit" | more Intermediate file error during pipe Rats!
> Lastly, is there anything in your autoexec.bat that > might potentially screw Rebol up? Just throwing > wild ideas around...
Next, I stripped the autoexec.bat down to the rebol_home line only. Rebooted, and no difference. Rats!
> "Intermediate file error" is suspicious. Have you tried > doing some similar redirection with another exe? Might > help the process of elimination...
Yeah, I thought the same thing. Tried several pipes; no problems!
> E.g. Assuming you have qbasic, how about creating a > test.bas file with the lines
<<quoted lines omitted: 3>>
> and then at the command prompt > echo "testing" | qbasic/run test.bas
Finally, did this and it worked the first time! (I had forgotten about the $ for strings in qbasic!! Looks funny now days.) Rats!
> I don't know if it will help but it is worth a try. > > Brett.
It was worth a try. Thanks for your time, Brett. Later, today, I'll try it on my wife's machine. She has a much cleaner and more recent Win98 install. Thanks, again. --Scott Jones

 [5/7] from: gjones05:mail:orion at: 29-May-2001 10:23


From: "Chris"
> ISTR that the dos prompt in Win98 is very > crufty. I know that file redirection is broken
<<quoted lines omitted: 5>>
> some people get it to work while others don't. > Chris
Good point, and to call the dos prompt "crufty" in Win98 is being very kind (the whole Windows "OS" on top of the real OS, MS-DOS, is really showing its age). As I mentioned to Brett, I'll try it later on my wife's machine which I built only recently. Maybe it'll represent a a cleaner Win98 install. Thanks for your ideas and time. --Scott Jones

 [6/7] from: michal:kracik at: 29-May-2001 19:46


Hi, I tried it in Windows 95 OSR2 and Windows 98 Second Edition. In Win95 it works, but Win98 prints "Intermediate file error during pipe" as Scott described! So it seems that Microsoft broke something between these releases. I tried to find with Google the error message or incompatibility between Windows 95 and 98, but didn't find anything useful. It's clear that both Win95 and Win98 "command.com" uses temporary files in %TEMP% and not real pipes like WinNT or 2000 "cmd". Regards, Michal Kracik Chris wrote:

 [7/7] from: gjones05:mail:orion at: 29-May-2001 13:53


From: "Michal Kracik"
> I tried it in Windows 95 OSR2 and Windows 98 Second Edition. In Win95 > it works, but Win98 prints "Intermediate file error during pipe" as
<<quoted lines omitted: 5>>
> Regards, > Michal Kracik
Thanks for giving it another go. I appreciate it. --Scott Jones

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted