You are not logged in.
Pages: 1
Hi,
My screenrc does not source my bashrc.
I put the line 'shell -$SHELL' on my screenrc to make every screen shell a login shell.
My ~/.bash_profile is sourcing my ~./bashrc which defines some alias which I would like to use.
Thanks.
Last edited by dabd (2009-10-17 12:40:14)
Offline
Perhaps the $SHELL var isn't evaluated? I use this line in .screenrc to do the trick:
defshell -bash # dash makes it a login shell
thayer williams ~ cinderwick.ca
Offline
Perhaps the $SHELL var isn't evaluated? I use this line in .screenrc to do the trick:
defshell -bash # dash makes it a login shell
I tried your way but it doesn't work either. I am baffled!
Thanks.
Offline
The line in screenrc that's causing me problems reads as:
screen -t shell 4 sshtunnel
where sshtunnel is an alias I defined in bashrc
According to the screen manual http://www.gnu.org/software/screen/manu … -screen-16
the screen command syntax
screen [opts] [n] [cmd [args]]
expects a cmd. Is it valid to specify an alias or it has to be some cmd in your $PATH?
Thanks.
Offline
The line in screenrc that's causing me problems reads as:
screen -t shell 4 sshtunnel
where sshtunnel is an alias I defined in bashrc
The problem is with the alias. As man bash states:
Aliases are not expanded when the shell is not interactive, unless the expand_aliases shell option is set using shopt (see the description of shopt under SHELL BUILTIN COMMANDS below).
Thus screen does not know of the alias when it reads .screenrc, because the shell it reads is not interactive.
To know or not to know ...
... the questions remain forever.
Offline
I ditched the alias and created a function in bashrc instead but it didn't work because it seems that bash doesn't export functions to other shells.
So I created a script in my ~/bin that just does what my alias did and problem solved!
If there is a more elegant solution I would be grateful to know about it.
Thanks.
Offline
Pages: 1