Subject: Re: odd behavior of pipe command (truly)

From: David Dyck <[email-masked]>
Date: Sat, 12 Sep 1998 16:23:01 -0700

This is a problem with your .cshrc, not pine

I don't use csh, but some of our .cshrc files
have the following lines at the beginning

if ( ! $?prompt ) exit 0
#   all interactive shells

The man page for csh states:
"  Noninteractive Operation
     When running noninteractively, the shell does not prompt for
     input  from the terminal.  "

You should set your .cshrc file to not run
 who am i when the prompt is not set 

On Sat, 12 Sep 1998, Mike Miller wrote:

> 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 '()'

what does your who am i command report,
 as I don't see where you get the domain name?

---

From: Mike Miller <[email-masked]>
Date: Sat, 12 Sep 1998 18:56:22 -0500 (CDT)

Thank you!!  Yes, that was exactly correct.  I am definitely a novice
.cshrc writer and I never really understood the use of the
"if-prompt-endif" part of the .cshrc.  I rewrote the .cshrc with the echo
lines and "who am i" lines in the "if-prompt-endif" paragraph.  Pipe now
works beautifully.

David also asked me (below) "what does your who am i command report, as I
don't see where you get the domain name?"  Answer:  On my system it just
greps a line out of 'who':

mbmiller@taxa:534> who am i
mbmiller   pts/5        Sep 12 15:26    (Mizzou-AS10-06.missouri.edu)

which is different from the behavior of whoami.  So my little script just
grabs (awks) the sixth word and takes off the parentheses.  It works, but
isn't so elegant.  Funny that I just learned a new thing in the middle of
writing this.  There is an environment variable $REMOTEHOST that contains
the information I am getting with my convoluted approach.  I can now
rewrite the .cshrc without the "who am i" and awk business by simply using
$REMOTEHOST in my aliases.

Thanks a million!

Mike