linux 终结器:如何 运行 一个 bash 脚本在完成后不关闭它

linux terminator: how to run a bash script not close it after done

我在 linux

中使用终结器终端

我正在尝试 运行 启动终结器后的 bash 脚本。

$ terminator -x sh /home/test/test.sh

它打开终止符 运行 脚本并在完成后关闭

我希望终结器在脚本执行后不要关闭

我没有在 terminator 的联机帮助页中找到像 termite 或 xterm 这样的 hold 选项,但我在这里 (1) 找到了 terminator 的答案:

It has an option similar to that in Gnome Terminal, you have to create a profile - e.g. called "hold" - with that option enabled.

To run command and stay open:

terminator -e '<command>' -p hold.
terminator -x sh -c '/home/test/test.sh; read -p "Press any key... " -n1'

terminator中执行脚本时,只运行你想要的shell,终止符将保留

terminator -e 'echo "This will stay" && zsh || zsh'

&&|| 将确保 shell 将执行,无论脚本成功或失败