1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/sh name=$1 shift if [[ -z "${name}" ]]; then echo "usage: $0 [name] [files]" exit 1 fi tar czfv "${name}.tgz" "$@"