小编Yoh*_* L.的帖子

执行 bash 函数来运行屏幕

我正在使用 aws ubuntu 实例。我想创建一个别名/函数来运行一些快捷方式,例如在屏幕中激活 python 虚拟环境。

我已经做了这个功能,例如:

# Alias for jupyter notebook
function start_jupyter() {
    cd my_path/lab_workspace/  # 1. cd into my workspace
    source labworkspaceenv/bin/activate  # 2. activate my python virtualenv
    screen -S jupyter_lab  # 3. start screen
    echo 'You are in screen for jupyter lab'  # 4. print something
    jupyter lab  # 5. start jupyter lab
}
Run Code Online (Sandbox Code Playgroud)

问题是,当我用 运行函数时start_jupyter,这似乎在 3. 之后停止。屏幕被创建,但没有打印任何内容并且 jupyterlab 没有启动。

我究竟做错了什么?

bash gnu-screen

6
推荐指数
1
解决办法
135
查看次数

标签 统计

bash ×1

gnu-screen ×1