Jupyter中的终端如何自动运行bash而不是sh [英] How can the terminal in Jupyter automatically run bash instead of sh

查看:996
本文介绍了Jupyter中的终端如何自动运行bash而不是sh的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢终端功能,并且非常适合我们的用例,我希望学生直接在终端上做一些工作,以便他们体验那种环境.自动启动的shell是sh,不会获取我所有的bash默认值.我可以输入"bash",并且一切正常.如何将"bash"设置为默认值?

I love the terminal feature and works very well for our use case where I would like students to do some work directly from a terminal so they experience that environment. The shell that launches automatically is sh and does not pick up all of my bash defaults. I can type "bash" and everything works perfectly. How can I make "bash" the default?

推荐答案

Jupyter使用环境变量$SHELL决定启动哪个shell.如果您使用init运行jupyter,则在Ubuntu系统上将其设置为dash.我的解决方案是在启动jupyter的脚本中使用export SHELL=/bin/bash.

Jupyter uses the environment variable $SHELL to decide which shell to launch. If you are running jupyter using init then this will be set to dash on Ubuntu systems. My solution is to export SHELL=/bin/bash in the script that launches jupyter.

这篇关于Jupyter中的终端如何自动运行bash而不是sh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆