Article View: gnu.bash.bug
Article #38Re: Init files (was Questions/bugs.)
From: James J Dempsey
Date: Wed, 21 Jun 1989 15:13
Date: Wed, 21 Jun 1989 15:13
41 lines
1704 bytes
1704 bytes
>> Date: Tue, 20 Jun 89 17:20:37 PDT
>> From: Brian Fox <bfox@aurel.caltech.edu>
>> Subject: Init files (was Questions/bugs.)
>>
>> Date: Tue, 20 Jun 89 10:02:58 -0400
>> From: James J Dempsey <jjd@bbn.com>
>>
>> Having said this, I think there should also be some way of determining
>> from inside .bashrc whether or not a given session is interactive or
>> not.
>>
>> In bash, if PS1 is not set, then the shell is not interactive.
>>
>> Brian Fox
Given, this fact, I can achieve my previously described three types of
init commands in this way:
Contents of .bash_profile:
source .bashrc
# Put all login session only type commands here
eval `tset -s ...` # an example, set terminal type
Contents of .bashrc
# Put commands which should always be executed here:
PATH=whatever; export PATH #an example, set the PATH
if [ -z "$PS1" ]
then
# Put all interactive only commands here
stty newcrt erase ^? # an example
fi
However, I still contend that .bashrc should be automatically sourced
by login shells. It is no problem to source it yourself, but I can't
think of any case where you *wouldn't* want to source .bashrc in
.bash_profile.
In any case, thanks, Brian, for your response.
--Jim--
Technical Details
Message-ID:
<8906211945.AA13645@AENEAS.MIT.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!BBN.COM!jjdReferences:
<8906210020.AA03847@aurel.caltech.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!BBN.COM!jjd From: jjd@BBN.COM (James J Dempsey) Newsgroups: gnu.bash.bug Subject: Re: Init files (was Questions/bugs.) Message-ID: <8906211945.AA13645@AENEAS.MIT.EDU> Date: 21 Jun 89 15:13:17 GMT References: <8906210020.AA03847@aurel.caltech.edu> Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 41