#65 Piping and Redirection not consistent on Linux


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


  • Klaus Alexander Seistrup

    Logged In: YES

    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


    ./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.


    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

    (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

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



Cancel  Add attachments

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

Sign up for the SourceForge newsletter:

No, thanks