1.sh
#!/bin/bash
setsid sh -c "/tmp/2.sh || echo 'hello or or'" > /tmp/2.log 2>&1 &
echo "1 exit"
exit
2.sh
#!/bin/bash
while true; do echo "hello2"; sleep 3; done
Bash脚本并发与错误处理技巧
1.sh
#!/bin/bash
setsid sh -c "/tmp/2.sh || echo 'hello or or'" > /tmp/2.log 2>&1 &
echo "1 exit"
exit
2.sh
#!/bin/bash
while true; do echo "hello2"; sleep 3; done
5430

被折叠的 条评论
为什么被折叠?