I'm sure there is an answer to this in the manual to screen, but I can't find it! I want the bash shell spawned by GNU screen to source in a file in addition to the .bashrc that it already runs.
I can't put a call to the file in .bashrc because on our site .bashrc files get regenerated automatically on login.
Any ideas?
EDIT:
I created this little script (screen_bash.sh):
bash --rcfile ~/.screen_bashrc
Then added
shell $HOME/screen_bash.sh
To my .screenrc
The ~/.screen_bashrc file was
<my_setup_stuff>
export SHELL=bash
The SHELL=bash is necessary so that programs like vim can launch sub-shells correctly.
Do you want this file to be sourced every single time a new screen window is opened? If so, the shell command allows you to overwrite what is run when you create a new screen window (by default it's just $SHELL). You can set this to be a script of your choice that at the end runs your shell.
screen bash --rcfile yourfile.rc
yourfile.rc
should source .bashrc
.
EDIT: This doesn't really do what you want, I just realised you probably want it to apply to all shells started by screen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With