Subject: Pipe Output: I don't want to be in the viewer!

From: Nancy McGough <[email-masked]>
Date: 16 Dec 1994 19:06:03 GMT

In Pine, is it possible to pipe a message to a program and have the
output displayed normally, i.e., not in the viewer.  E.g., how would
I get ``|cat'' to just cat the message, i.e., display the whole message,
scrolling off the screen if necessary?

Thanks much,
Nancy

--
 /\_/\    Nancy McGough
( o.o )   Infinite Ink
 > ~ <    http://www.jazzie.com/ii/  -OR-  http://www.best.com/~ii/

---

From: [email-masked] (Jim Davis)
Date: 16 Dec 1994 15:57:56 -0700

In article <[email-masked]>, Nancy McGough  <[email-masked]> wrote:
:In Pine, is it possible to pipe a message to a program and have the
:output displayed normally, i.e., not in the viewer.  E.g., how would
:I get ``|cat'' to just cat the message, i.e., display the whole message,
:scrolling off the screen if necessary?

cat >/dev/tty, of course.

Though there is a complication: Pine has adjusted the terminal
settings to suit its needs, and those are at odds with the settings
you normally use.  So while 'cat >/dev/tty' should work, it will look
pretty messy.

To get things looking nicer, you have to do a bit more work.  You have
to save the terminal state that Pine uses, then adjust the terminal
state to a 'normal' one, then run cat, then set the terminal state
back the one Pine needs.  And do that all in a subshell. On my system
this did the trick:

@{stty -g </dev/tty >stty.pine; stty `{cat stty.g} >/dev/tty; cat >/dev/tty; 
  stty `{cat stty.pine} >/dev/tty}

(Though your stty command might work differently and you probably aren't
using the rc shell.)

I ran 'stty -g >stty.g' in a (normal) xterm window to generate the
'normal' terminal settings.

If you want to do this more than once then you probably want to
package all that in a shell script.