Having read the docs and following this answer, I wanted to test it with a simple example:
test_1.sh
#!/usr/bin/bash
let x=1/0
echo $x
test_2.sh
#!/usr/bin/bash
printf "\nThis is 2\n"
But both of these implementations of control flow fail: run test_1, if unsuccessful, run test_2
# Just errors on line 1 of course
./test_1.sh
if [ $? -ne 0 ]; then
./test_2.sh
fi
Also fails:
./test_1.sh || ./test_2.sh
Any tips for controlling flow between multiple scripts?