Answers:
放在$SHELL脚本的末尾:

一个小缺陷:由于gnome-terminal未运行bash外壳程序,因此将其视为应用程序,并在您尝试关闭终端时显示警告:
There is still a process running in this terminal
Closing the terminal will kill it.
我找不到隐藏此警告的好方法。如果需要,可以通过运行以下命令完全禁用它:
gconftool --set /apps/gnome-terminal/global/confirm_window_close --type boolean false
如果您使用的xterm不是gnome-terminal,则不会发生这种情况;应该打扰你。
对临时管道使用bash的--init-file选项:
bash --init-file <(echo './<script_name>')
例如:
bash --init-file <(echo './bla.sh')
exec $SHELL而不只是$SHELL使警告消失而不更改设置。