diff --git a/scripts/mcp_and_decompress.sh b/scripts/mcp_and_decompress.sh new file mode 100755 index 0000000..5e4d223 --- /dev/null +++ b/scripts/mcp_and_decompress.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +INFILES=${@:1:$#-1} +OUTDIR=${@:$#} + +for INFILE in $INFILES; do + if [[ $INFILE == *.gz ]]; then + OUTFNAME=$(basename $INFILE .gz) + pigz -dc $INFILE > "$OUTDIR/$OUTFNAME" + elif [[ $INFILE == *.zst ]]; then + OUTFNAME=$(basename $INFILE .zst) + zstd -d $INFILE -o "$OUTDIR/$OUTFNAME" + else + OUTFNAME=$(basename $INFILE) + cp $INFILE "$OUTDIR/$OUTFNAME" + fi +done