🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Thomas M. Breuel Wed, 13 Sep 1989 01:40
Re: bash seems to execute ".profile" when it shouldn't
#582
Author: Thomas M. Breuel
Date: Wed, 13 Sep 1989 01:40
28 lines
1803 bytes
	to quote from my locally hacked version of bash 1.03:
	|   /* This is the only way I know how to find an rsh shell.
	|      If this shell is remote (rsh host command), then make
	|      sure that we run the .login stuff so that the user can
	|      set his/her PATH. */

	 It's a feeture. Honest. Feel free to ifdef it out; I do.

If rsh wanted a login shell, it would invoke the shell with a "-" as 
its first argument. For a variety of reasons, rsh doesn't. If that's
the behavior someone wants for rsh, he should change the behavior
of rsh, not of the shell.

The reason why it's a bad idea to make the shell source the .profile
is that (1) .profile's are written with the assumption that they'll
only get executed on login, so they will often change tty modes 
(which gives error output when done from inside rsh) and ask
for user input (like terminal type); (2) someone may just type "bash"
from another non-bash shell and have his .profile executed
(and what about a bash script that is executed by a non-bash user? What
about "bash file"? What about "bash < file"?)

Now, as far as I'm concerned, it would be OK if bash executed
a ".bash_login" file (I would simply not have one of those). However, 
the semantics of the .profile are determined by the Bourne shell, 
and if bash deviates too far from them, it will be impossible to go 
back and forth between the two.
Re: bash seems to execute ".profile" when it shouldn't
#594
Author: Rob McMahon
Date: Thu, 14 Sep 1989 22:24
21 lines
1595 bytes
In article <8909130140.AA03372@wheat-chex> tmb@AI.MIT.EDU (Thomas M. Breuel) writes:
|	to quote from my locally hacked version of bash 1.03:
|	|   /* This is the only way I know how to find an rsh shell.
|	|      If this shell is remote (rsh host command), then make sure that
|	|      we run the .login stuff so that the user can set his/her PATH.
|
|If rsh wanted a login shell, it would invoke the shell with a "-" as 
|its first argument. For a variety of reasons, rsh doesn't. If that's the
|behavior someone wants for rsh, he should change the behavior of rsh, not of
|the shell.

This is vital.  It is quite normal for people to put things in .profile that
produce output.  Anything like this will blow rsh away (it will break the
protocol, since it is not expecting output).  Anything like PATH should be set
in the .bashrc.

Rob
-- 
UUCP:   ...!mcvax!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             ARPA:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads