我基本上需要在不同的终端中自动运行2个命令。
while :
do
timeout 10 gnome-terminal --geometry=95x56 -e "COMMAND1" &&
timeout 7 gnome-terminal -e "COMMAND2" &&
sleep 30
done
预期行为:
实际行为:
这里发生了什么?
根据What is the appropriate action when the answer to a question is added to the question itself?,自我回答从问题转移到社区Wiki答案:
如下所示,只允许第一个命令保持打开状态,而在循环中运行第二个命令:
COMMAND1 &
while :
do
sleep 15
gnome-terminal -- timeout 7 COMMAND2 &&
sleep 30
done