Subject: unix: pipe to cat throws me in a viewer?

From: [email-masked] (Tony Gonzalez)
Date: 16 Jan 1997 07:45:08 GMT

If I pipe  a message to 'cat' I get into a viewer,
and the message never scrolls through the screen
from beginning to end.  Anyone know what gives?

Thanks 

-Tony

.   .   .   .  . . . . . . . . ._______________________________________.
                               | [email-masked] | http://www.crl.com/~oak |
                               |_____________|___ Southern California _|

---

From: Tony Gonzalez <[email-masked]>
Date: 23 Jan 1997 03:01:36 GMT

Orjan Johansen <[email-masked]> wrote:
: In article <[email-masked]>, Tony Gonzalez <[email-masked]> wrote:
: >If I pipe  a message to 'cat' I get into a viewer,
: >and the message never scrolls through the screen
: >from beginning to end.  Anyone know what gives?

: Any output from a piped command is shown in a viewer, as you say. The 
: viewer accepts the usual pine browsing keys.

: Maybe if you do 'cat >/dev/tty' it will get around that; I haven't 
: checked.

This worked, but the text was all over the place, that is, the
lines didn't all begin on the first column....it seemed like all
the line feeds had been removed.

Thanks

-Tony

---

From: [email-masked] (Orjan Johansen)
Date: 25 Jan 1997 02:52:28 GMT

>the line feeds had been removed.

A quick check with the stty program reveals that pine changes the terminal
mode into one with 'ocrnl' unset - this means that line feed characters
are not treated as newlines, but just as vertical motion.

You need to replace cat by something which will translate line feed into
carriage return + line feed - a Unix to DOS filter, essentially. The
following perl command will work:

perl -p -e 's/$/\015/' >/dev/tty

Greetings,
Ørjan.