Thread: screen and bash
View Single Post

   
  #3 (permalink)  
Old 02-20-2008, 06:42 PM
Mewla Penn
 
Posts: n/a
Default Re: screen and bash

On 2006-11-02, Jeffrey Froman <jeffrey@fro.man> wrote:
> I have noticed the same thing.


I'm glad I wasn't imagining it.

> It seems that with or without the "shell" setting, .bashrc is processed when
> screen starts. One easy solution is thus to add a line to .bashrc, like:
>
> source .bash_profile


Ah. That conflicts with how I have it arranged.

To the best of knowledge, bash works like this:
at startup, if it's an interactive login shell, it loads /etc/profile,
and then it loads the first one it finds of ~/.bash_profile,
~/.bash_login or ~/.profile.

If it's interactive, but not a login screen, it just loads ~/.bashrc.

I have plenty of situations where I enter my systems and sometimes it's
login (ssh) and sometimes it's not (sftp). As best I can, I set it to be
login, like I have done with screen for years, but now find it not
working.

So in .bashrc I source /etc/profile. And then set my environment
variables and PATHs and do things that produce no output. I discovered a
long time ago that if .bashrc produces output, it screws up sftp
(Received message too long 1215655020).

In .bash_profile, I source .bashrc, and then set my prompts and aliases
and run a few commands. That way, the environment variables are only one
file (.bashrc) but are available to both login shells and non-login
shells.

How have others arranged their bash startup files?

Reply With Quote