Avoid gnome-terminal close after script execution?

2019-01-03 09:08发布

I created a bash script that opens several gnome-terminals, connect to classroom computers via ssh and run a script.

How can I avoid that the gnome-terminal closes after the script is finished? Note that I also want to be able to enter further commands in the terminal.

Here is an example of my code:

gnome-terminal -e "ssh root@<ip> cd /tmp && ls"

7条回答
仙女界的扛把子
2楼-- · 2019-01-03 09:32

Use nohup command.

nohup gnome-terminal -e "ssh root@ cd /tmp && ls"

Hope this will help you.

查看更多
登录 后发表回答