我正在编写一个 shell 脚本来启动一个虚拟机(ubuntu)。在命令之后,我想放置一个 for 循环来继续检查 virtualbox 的状态,并且只有在 ubuntu 完全启动后脚本才会退出循环。就像是
vboxmanage starvm Ubuntu
for (i= 0; i < 100; i++)
{
continue if (vbox is not on)
}
Run Code Online (Sandbox Code Playgroud)
当 vbox 完全打开时退出并执行下一个命令