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

  • Thread starter Mills Thomas (app1tam)
  • Start date
M

Mills Thomas (app1tam)

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
 
N

nobu.nokada

Hi,

At Wed, 15 Oct 2003 03:05:44 +0900,
Mills said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,137
Messages
2,570,797
Members
47,342
Latest member
eixataze

Latest Threads

Top