#!/usr/bin/sh if [[ $# -eq 0 ]]; then echo "Usage: $0 " exit fi containers=$(ls $1/*.tgz) if ! type "pv" > /dev/null; then echo 'pv' command not found on your system, install it to get a nice progress indicator... else PV=" pv " fi for container in $containers do stripped_container=$(basename $container .tgz) echo "Container: $container => ${stripped_container//_/\/}" gzip -d -c $container | $PV | docker load done