#65 Piping and Redirection not consistent on Linux

v3.0
closed
5
2012-08-14
2005-04-26
No

See the attached program. When run with these command
lines on Linux the result is not the same.

./test.rex < ./test.rex -- incorrect result
cat ./test.rex | ./test.rex -- correct result

Version 3.0.0 of ooRexx
Fedora Core 3 Linux

Discussion

  • Klaus Alexander Seistrup

    Logged In: YES
    user_id=22514

    In a simple forever-loop that reads from .input and copies
    to .ouput ooRexx behaves erratically.

    testseq.txt contains the numbers {1..7}, one on each line,
    lines being terminated by LF (ASCII 10).

    testeof.rexx is a rexx script that demonstrates the bug. It
    copies .input to .output while reporting on .error what is
    happening.

    (1)

    ./testeof.rexx < testseq.txt

    .input~chars() reports the correct number of available
    chars. However, the script only copies the first line of
    testseq.txt, then exits.

    (2)

    cat testseq.txt | ./testeof.rexx

    All the lines of testseq.txt are being copied. However,
    .input~chars() reports 1 single char only being available at
    each loop.

    NB: The situation is more complicated than what is apparrent
    from the simple case above. If the input file contains
    "long" lines (say > 128 characters), then the lines are not
    copied verbatim.

    This is on Ubuntu Linux ("Hoary"):

    $ uname -a
    Linux main 2.6.10-5-k7 #1 Tue Apr 5 12:56:05 UTC 2005 i686
    GNU/Linux
    $

    (I'm not sure how to attach files to this comment, so I
    might send them by mail to wdashly if I fail attaching them.)

     
  • David Ashley

    David Ashley - 2006-03-01

    Logged In: YES
    user_id=931756

    This behavior has now been documented in the README.txt file.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks