[oclug] Starting an X Windows term

Patrick Ouellette ouellep at algonquincollege.com
Wed Aug 29 08:32:56 EDT 2001


Good lord, I never intended to start an intellectually conceptual war on 
this !! :)
My poor brain canna take no more, captain !! She's going to blow !!!

But, so far, I've worked most of it out and it seems to work not too bad.

At 02:02 AM 8/29/2001 -0400, Gilles J. Seguin wrote:
>Joe Burpee wrote:
> >
> > On 01/08/28 21:30:53, Gilles J. Seguin wrote:
> > > ~/.bashrc by default is not source as a personal file if shell is
> > > interactive.
> >
> > Really?  News to me.  Cf man bash.
>
>When  bash is invoked as an interactive login shell, or as
>a non-interactive shell with the --login option, it  first
>reads and executes commands from the file /etc/profile, if
>that file exists.  After reading that file, it  looks  for
>~/.bash_profile,  ~/.bash_login,  and  ~/.profile, in that
>order, and reads and executes commands from the first  one
>that  exists  and is readable.  The --noprofile option may
>be used when the shell is started to inhibit  this  behavior.

I would tend to think so as well, but have been proven wrong on THAT topic 
when it comes to some of the distro's.
Specifically Debian, Slackware and FreeBSD do not seem to approach it in 
quite exactly that manner,  I was told.


> > > ~/.bashrc            is not source as a personal file if shell is login.
> > > It is the a common practice to have ~/.bash_profile to source
> > > the personal ~/.bashrc file.
> >
> > I don't see your point Gilles.  I suggested *not* putting login stuff in
> > .bashrc; then it won't matter that it's sourced.
> >
> > > if ~/.bashrc is source by ~/bashrc_profile, you must
> > > if [ "xSHLVL = "x1" ]; then
> > >     #what we try to do;
> > > fi
> >
> > I assume you mean something like [ "$SHLVL" = 1 ].  Be careful, because
>
>WUP
>
> > it could just be a login shell started under an xterm, say.  (E.g.
> > `su -'.)  SHLVL is often not very helpful or safe.  I don't use the RH
> > bashrc in part because of this.
>
>~ $ su -
>Password:
>~ # cat >> .bashrc
>echo "SHLVL is:$SHLVL"
>^D
>~ # echo $SHLVL
>1
>~ # exit
>~ $ su -
>Password:
>SHLVL is:1
>~ #
>
>OK, gets it
>
>Which test are you suggesting.
>
> > > My preference to add this fonctionnality would be to create files
> > > xfree86.sh and xfree86.csh in /etc/profile.d directory.
> > > Which is the common pratice to add fonctionnality to /etc/profile file
> > > by programme setup manager such as for example tar and rpm.
> >
> > Personally I think all that profile.d clutter is out of control; at
> > least it doesn't belong in bashrc.  I think bashrc should be used for
> > things like aliases where it is necessary.  Otherwise it just fouls up
> > the environment that has been quite properly exported by /etc/profile,
> > ~/.bash_profile, etc.
>_______________________________________________
>oclug mailing list
>oclug at lists.oclug.on.ca
>http://www.oclug.on.ca/mailman/listinfo/oclug


Sincerely,

Patrick Ouellette
Coordinator- Computer Studies / Computer System Technician Program
Algonquin - Rideau Campus Room B206b
Phone: (613) 727-4723 ext 5904 / (613) 851-0873
E-Mail: pat at myrrdin.com / ouellep at algonquincollege.com
Web: http://www.algonquincollege.com/staff/ouellep




More information about the OCLUG mailing list