Linux 系统中wait命令
001、
(base) [root@PC1 test]# ls
test.sh
(base) [root@PC1 test]# cat test.sh
#!/bin/bash
# 启动三个后台进程
echo hello world &
sleep 20 &
seq 10000000000 > a.txt &
# 等待第一个作业完成
wait -n
echo "First job completed."
# 等待所有作业完成
wait
echo "All jobs completed."
(base) [root@PC1 test]# bash test.sh
hello world
First job completed.
01、
来源:https://blog.csdn.net/u011805907/article/details/136241222