screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash aliases


From: Stephane Chazelas
Subject: Re: bash aliases
Date: Mon, 12 May 2008 12:38:24 +0100
User-agent: Mutt/1.5.16 (2007-09-19)

On Mon, May 12, 2008 at 08:52:21PM +1000, Chris Henderson wrote:
> None of my bash aliases seem to be working from inside screen. Is
> there any way I could get my .bashrc commands working inside screen?
> Here's my .screenrc file. Thanks for any help.
> 
> defscrollback 50000
> shell -$SHELL

That starts a login shell. Bash has a misfeature in that login
shells don't read the .bashrc. They only read the .bash_profile. 

You would have the same problem when login in.

So either remove that line, or update your ~/.bash_profile so
that it reads your bashrc, something like:

[ -f ~/.bashrc ] && [ -r ~/.bashrc ] &&
  case $- in (*i*) . ~/.bashrc;; esac

That is a dirty hack. For instance, it doesn't work OK in cases
where bash is called with --login --rcfile /other/file

Also, some bash are built with support of a system wide bashrc.
Then, you might want to do something similar in /etc/profile if
you're the system administrator. (with an additional test that
the shell is bash as /etc/profile is shared by several shells)

IMO, zsh is a much better choice as an interactive shell.

Cheers,
Stéphane




reply via email to

[Prev in Thread] Current Thread [Next in Thread]