I have a bash script that calls another script and I capture the stdout. If there is an error, I want to print the result. However; only the first word of the child script is displayed?
error_return() {
echo "Error received during '$1' execution. Log:"
while IFS= read line; do
echo " $line "
done <<< $2
}
build_doc() {
echo "Building documentation"
docbuild=$(bin/doc-build.sh)
wait
if [ $? -eq 0 ]; then
echo "Documentation built."
else
error_return "build_doc" $docbuild
fi
}
What do I do to show all the result text?