Subject: odd behavior of pipe command (truly)

From: Mike Miller <[email-masked]>
Date: Sat, 12 Sep 1998 09:43:08 -0500 (CDT)

I'm running Solaris 2.6 with pine 4.02 binary for Solaris 2.5 downloaded
from the pine ftp site.  My apologies if this bug was fixed in 4.03.  I'm
not sure if the earlier versions of pine did this.

When I run the pipe command, pine sources my .cshrc file.  It must have to
create it's own shell, eh?  The problem is that pine puts any output
(errors, etc.) from this source command in the viewing window.  For me,
this causes pine to generate the following text (between but not including
the lines) which it places on the viewing window just before the piped
text.

--------------------------------------------------------------------------
Must be attached to terminal for 'am I' option

Must be attached to terminal for 'am I' option
My best guess at your address and display is :0.0
If this is wrong, X-server aliases will not work for you during this
session until you change $display using the set command.  If a program gives
you an error, precede the program name with a '\' as in \pico or \pine
or \telnet.
--------------------------------------------------------------------------

So I think the bug causes output of "source .cshrc" to be piped to the
viewing window ahead of the output from the requested pipe operation.  
The same thing happens when I click on a URL to open a netscape window,
but the text only appears for a second while the netscape window opens,
then the e-mail message reappears without the extra text.

I can explain the causes of the lines of text shown above.  First, I have
a line that tries to determine where I'm logged in from.  It uses "who am
i".  Apparently, that causes the "Must be attached to terminal" error
messages.  The second bunch of text is caused by a series of echo
commands.

P.S.  Offtrack: Is there a better way for my Solaris box to get the domain
name of a user than

who am i | awk '{print $6}' | tr -d '()'

It seems to work, but there has to be a better way!  Isn't there a single
command for this?

Regards,

Mike

Michael B. Miller, M.S., Ph.D., M.P.E.
Department of Psychology
210 McAlester Hall
University of Missouri--Columbia
Columbia, MO 65211
 Phone: (573) 882-5671
   Fax: (573) 882-7710
e-mail: [email-masked]
   web: http://taxa.psyc.missouri.edu/~mbmiller/

-----------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/pine/pine-info/
-----------------------------------------------------------------

---

From: Michael Thomas Cope <[email-masked]>
Date: Sat, 12 Sep 1998 17:14:30 -0700 (PDT)

> who am i | awk '{print $6}' | tr -d '()'
That's better than us ;-)
who -m | tr -s " " "\012" | tr -s "\011" "\012"|grep "(" | tr -d    "()"`

BTW, you should have this in /etc/.login or ~/.login rather than .cshrc
because it only changes at login.
-Mike
-- 
Michael Cope: Harvey Mudd College '00; Armand Hammer UWC '96
E-mail: [email-masked]