I have this piece in which the variable TESTS_SUCEEDED disappears or its value is unset. I saw many examples in which variables disappear due to subshell starting in loops, but couldn't find any clue about this behaviour.
${SRCDIR}/3rdParty/bin/alxdatabasemanager
--create-database-with-name=TestAlexandriaDB || exit 1
Src/Tests/Functional/FunctionalTestLibalexandria
TESTS_SUCCEEDED="$?"
#Here variable exists
echo ${TESTS_SUCEEDED}
${SRCDIR}/3rdParty/bin/alxdatabasemanager
--delete-database-with-name=TestAlexandriaDB || exit 1
#FIXME: Variable nonexisten here or value lost??!! Why?
exit ${TESTS_SUCCEDED}
Could anyone tell me what is going on? Thanks in advance.
exit 1on a previous line exited your script beforeexit ${TESTS_SUCCEDED}had a chance to use it?