there is a script, 1.sh. 1.sh starts 1a.sh and then 1b.sh.
But how to exit all scripts, how to exit 1.sh and how to not start 1b.sh if 1a.sh breaks with an error?
Just make it like:
#! /bin/sh - 1a.sh && 1b.sh Or
#! /bin/sh - 1a.sh || exit 1b.sh Or:
#! /bin/sh - set -o errexit 1a.sh 1b.sh Like you'd do for any command. The fact that those commands are shell scripts (programs written in a shell language; that's not what we call subshells btw) or not (programs written in another language, interpreted or not) makes no difference here.
The errexit option, when enabled causes failure (based on exit status) of any command to exit the script. There are a number of exceptions though such as when the command is (possibly remotely) "involved in a condition statement", with arcane and not necessarily intuitive rules that vary from shell to shell, so is in general best avoided for anything but very simple scripts.