Jupyter中的终端如何自动运行bash而不是sh

编程入门 行业动态 更新时间:2024-10-12 05:55:32
本文介绍了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

本文发布于:2023-10-09 05:34:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1474847.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:终端   自动运行   而不是   Jupyter   bash

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!