defines a script B that receives two parameters, roughly logical:
if [true]; then
echo "12"
exit 0;
else
echo "error"
exit 0;
fi
exit 0;
now call this script in another shell script A:
RESULT=./B "para1" "para2"
the problem now is that RESULT does not receive the information returned by echo in B, such as "12" or "error", and always reports an error when running.
could you tell me how to write such a script? Shouldn"t I use RESULT to receive it? Then how to get the information from echo in B? Or how to get the information back in the B script?