#!/bin/bash if [ -x "$(which pigz)" ]; then exec tar cf - "${1%%/}/" | pigz > "${1%%/}.tgz" else exec tar czf "${1%%/}.tgz" "${1%%/}/" fi