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