I want to exec bash script from URL.
I use sh -c "$(curl -f ${SCRIPT_URL})"
.
It is worked, but parent script complete successfully if url is incorrect or child script give error.
Example:
set -e
sh -c "$(curl -f ${SCRIPT_URL})"
echo "success"
I can get a need error with using an additional variable:
set -e
url=$(curl -f ${SCRIPT_URL})
sh -c "$url"
echo "success"
But I don't want to use an additional variable. Is it possible to do it without additional variable?