Created
January 21, 2017 07:22
-
-
Save hodlbirb/0eab5d589d10e53a6cbbcc479b793eeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -c file - compress file | |
# -d file - decompress file | |
while getopts ":c:d:" opt; do | |
case $opt in | |
c ) cut -d' ' -f1,3,4,5,6 $OPTARG | gzip -k -9 > comp.gz;; | |
d ) gzip -d $OPTARG --stdout | sed -e "s/\([0-9]\{2\}:[0-9]\{2\}\)\(:[0-9]\{2\}\)/\1\2 \1/" > decomp.txt;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment