ravenous.dev/tools/tarcat.sh
#!/bin/sh -e if [ -z "$1" ]; then printf 'usage: %s <output> [tar files]...\n' $0 >&2 echo concatenate tar files >&2 exit 1 fi out="$1" shift 1 while [ -n "$1" ]; do if printf %s "$1" | grep -vq '^-'; then # ignore flags if ! [ -f "$1" ]; then cp "$1" "$out" else tar --concatenate --file="$out" "$1" fi fi shift 1 done