Skip to content

Commit

Permalink
add multi-file version
Browse files Browse the repository at this point in the history
  • Loading branch information
dpark01 committed Dec 12, 2023
1 parent 5e64745 commit 4708cec
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/mcp_and_decompress.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4708cec

Please sign in to comment.