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

Discussion in 'Ruby' started by Mills Thomas (app1tam), Oct 14, 2003.

  1. 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
     
    Mills Thomas (app1tam), Oct 14, 2003
    #1
    1. Advertising

  2. Mills Thomas (app1tam)

    Guest

    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
     
    , Oct 15, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christian Long
    Replies:
    3
    Views:
    10,285
    Duncan Booth
    Jun 26, 2003
  2. Apple Grew

    Help wanted in piping in Windows

    Apple Grew, Jun 23, 2005, in forum: Python
    Replies:
    2
    Views:
    325
    Peter Hansen
    Jun 24, 2005
  3. anansi
    Replies:
    1
    Views:
    96
  4. James Coglan

    Piping data in on the command line

    James Coglan, Jul 9, 2008, in forum: Ruby
    Replies:
    5
    Views:
    195
    ara.t.howard
    Jul 11, 2008
  5. P. A.
    Replies:
    0
    Views:
    152
    P. A.
    Sep 4, 2009
Loading...

Share This Page