# shellcheck disable=SC2016 # 200000 nested parentheses must be reported, not overflow the stack. # dash and bash both crash on this. The expression goes into the shell's # stdin, not into a file: on z/OS a redirect of another program's output gets # tagged and converted, which garbles a generated ASCII script. Only the head # of the message is looked at, because some seds choke on a 400 KB line. command -v python3 >/dev/null 2>&1 || exit 77 gen() { python3 -c 'print("echo $((" + "("*200000 + "1" + ")"*200000 + "))")'; } gen | "$TSH" >/dev/null 2>&1 echo "status $?" if gen | "$TSH" 2>&1 >/dev/null | head -c 200 | grep -q "expression nested too deeply"; then echo "message ok" fi "$TSH" -c 'echo $(((((1)))))'