I have this in a bash script:
exit 3;
exit_code="$?"
if [[ "$exit_code" != "0" ]]; then
echo -e "${r2g_magenta}Your r2g process is exiting with code $exit_code.${r2g_no_color}";
exit "$exit_code";
fi
It looks like it will exit right after the exit command, which makes sense. I was wondering is there some simple command that can provide an exit code without exiting right away?
I was going to guess:
exec exit 3
but it gives an error message: exec: exit: not found.
What can I do? :)
exec exit 3is no bueno, I get"exec: exit: not found"– MrCholo 14 hours agoexit_code=3and eliminate theexit 3line altogether? – wjandrea 4 hours ago