diff --git a/src/datastore_mad/remotes/downloader.sh b/src/datastore_mad/remotes/downloader.sh index b387bd2d98..d5be9ae5c9 100755 --- a/src/datastore_mad/remotes/downloader.sh +++ b/src/datastore_mad/remotes/downloader.sh @@ -188,8 +188,10 @@ esac file_type=$(get_type "$command") decompressor=$(get_decompressor "$file_type") +# Note: the 'cat' at the end of this pipeline forces the pipe to wait until +# all the 'tee' processes are finished $command | tee >( decompress "$decompressor" "$TO" ) \ - >( hasher $HASH_TYPE ) >/dev/null + >( hasher $HASH_TYPE ) | cat >/dev/null if [ "$?" != "0" ]; then echo "Error copying" >&2