$ for file in test?*.bashrc testvarscreenrc template; do echo "=== $file"; cat "$file"; done; echo "===" === test0.bashrc . ~/session/testcommon.bashrc cd ~/test echo Test # history -n # history 10 # history -s 123 === test10.bashrc . ~/session/testcommon.bashrc cd ~/test echo Test # history -n history 10 # history -s 123 === test10s.bashrc . ~/session/testcommon.bashrc cd ~/test echo Test # history -n history 10 history -s 123 === testcommon.bashrc echo Common #. /etc/bash.bashrc #. ~/.bashrc PS1='$ ' HISTFILE=~/session/test_history unset HISTTIMEFORMAT === testn.bashrc . ~/session/testcommon.bashrc cd ~/test echo Test history -n # history 10 # history -s 123 === testn10.bashrc . ~/session/testcommon.bashrc cd ~/test echo Test history -n history 10 # history -s 123 === testn10s.bashrc . ~/session/testcommon.bashrc cd ~/test echo Test history -n history 10 history -s 123 === testns.bashrc . ~/session/testcommon.bashrc cd ~/test echo Test history -n # history 10 history -s 123 === tests.bashrc . ~/session/testcommon.bashrc cd ~/test echo Test # history -n # history 10 history -s 123 === testvarscreenrc source ../.screenrc screen -t test 0 bash --rcfile ~/session/$testvar.bashrc === template foo bar baz qux === $ $ cp -a template test_history && testvar=test10s screen -Rd test -c ~/session/testvarscreenrc