Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Piping to windows command line .rb file doesn't work

Reply
Thread Tools

Piping to windows command line .rb file doesn't work

 
 
Mills Thomas (app1tam)
Guest
Posts: n/a
 
      10-14-2003
If I do this:

home> type cat.rb

I get this output:

print $stdin.readlines

If I do this:

home> type cat.rb | ruby -e "print $stdin.readlines"

I get this output (NOTE, it's the same):

print $stdin.readlines

If I type this command (.rb has been associated to ruby.exe on Win2K):

home> type cat.rb | cat.rb

I get this output:

cat.rb:1:in `readlines': Bad file descriptor (Errno::EBADF)
from cat.rb:1

Any ideas why this doesn't work?

Drew

 
Reply With Quote
 
 
 
 
nobu.nokada@softhome.net
Guest
Posts: n/a
 
      10-15-2003
Hi,

At Wed, 15 Oct 2003 03:05:44 +0900,
Mills Thomas (app1tam) wrote:
> If I type this command (.rb has been associated to ruby.exe on Win2K):
>
> home> type cat.rb | cat.rb
>
> I get this output:
>
> cat.rb:1:in `readlines': Bad file descriptor (Errno::EBADF)
> from cat.rb:1


It's a known feature (or bug) of cmd.exe. You'd better claim
to the vender rather than to us. We can do nothing about it at
all.

--
Nobu Nakada

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JSpec command line run command doesn't work P. A. Ruby 0 09-04-2009 02:30 AM
Read a file line by line and write each line to a file based on the5th byte scad C++ 23 05-17-2009 06:11 PM
Piping data in on the command line James Coglan Ruby 5 07-11-2008 06:08 PM
How does piping with ruby work? anansi Ruby 1 04-22-2007 03:15 PM
Piping data into Python on the command line - Windows 2000 Christian Long Python 3 06-26-2003 08:28 AM



Advertisments