#!/bin/bash set -euo pipefail if [[ $# -ne 2 ]]; then echo "Usage: $0 " exit 1 fi LISTFILE="$1" OUTPUT="$2" if [[ ! -f "$LISTFILE" ]]; then echo "Error: file list '$LISTFILE' not found." exit 1 fi rm -f "$OUTPUT" # Create a tar.gz archive containing all paths in LISTFILE tar -cvzf "$OUTPUT" -T "$LISTFILE" echo "✅ Archive created successfully: $OUTPUT"