I have this command:
echo $(bash main.sh)
In main.sh
, I run a java program that simply throws an exception immediately. The exit code of echo is 0 which means the command succeeded. Is there anyway to make it fail with the exit code from bash main.sh
?
The use of echo
is not mandatory, it can be replaced with another program.