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
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