我想运行一个数据收集脚本,对于每个循环:
打开新终端以在其中运行机器人模拟过程
在父终端中运行另一个 process2
当 process2 完成后,关闭所有在 step1 中打开的模拟器终端
我已经阅读了许多其他关于关闭终端的问答。我挣扎的是,我希望在父进程始终运行的情况下保持父终端打开。理想情况下,我希望能够跟踪我的脚本打开的每个子终端,以便我可以选择稍后关闭它们。但是,我也可以只关闭所有其他终端而不检查它们是否是当前脚本的子项,如果这会让我的生活更轻松。
我对如何识别每个终端的了解非常有限。我知道每个进程都有一个进程 ID,但是终端呢?它何时以及如何与进程不同(请参阅下面的示例,该示例让我对终端/进程 ID 感到困惑)?
我尝试使用其他相关问答的答案编写下面的脚本。
parent_terminal=$(xdotool getactivewindow)
echo "parent_terminal: $parent_terminal"
# TODO: start external loop
# open a child terminal(s) and run robot_sim there
#(gnome-terminal -e './robot_sim')
#echo $! --> gives blank..
#./process2
#echo "process2 done. Killing robot_sim.."
# Kill all other terminals except this one (the parent)
xdotool search --class "terminal" | while read id
do
if [ "$id" -eq "$parent_terminal" ]; then
echo "This is parent_terminal $parent_terminal"
echo …
Run Code Online (Sandbox Code Playgroud) 症状(蓝牙开关只能设置为关闭),我收到的错误消息与这个问题几乎相同,但我运行的是 14.04,64 位。我可以获取 14.04 版本的固件吗?谢谢!
$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Device [8086:5904] (rev 02)
00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:5916] (rev 02)
00:08.0 System peripheral [0880]: Intel Corporation Sky Lake Gaussian Mixture Model [8086:1911]
00:13.0 Non-VGA unclassified device [0000]: Intel Corporation Device [8086:9d35] (rev 21)
00:14.0 USB controller [0c03]: Intel Corporation Device [8086:9d2f] (rev 21)
00:14.2 Signal processing controller [1180]: Intel Corporation Device [8086:9d31] (rev 21)
00:16.0 Communication controller [0780]: Intel Corporation …
Run Code Online (Sandbox Code Playgroud)