如何从bash在linux屏幕上创建额外的终端

时间:2014-11-18 08:33:44

标签: linux bash shell gnu-screen

在屏幕中,您可以按ctrl+a c在同一屏幕会话中创建新终端。现在我必须自动执行此活动并从我的bash脚本执行相同的操作:

dbus-launch screen
finch
ctrl+a c <--------- HOW TO CHANGE THAT LINE?
python myscript

任何提示?

1 个答案:

答案 0 :(得分:0)

screen -S <session> -X screen <command to run in the new window>

首次创建屏幕会话时,您应该添加会话标记。

示例:

# Create screen session named myscreen and detach.
dbus-launch screen -S myscreen -d -m
# Do something
# ...
# Create a new screen window and launch python on it.
screen -S myscreen -X screen python -v