Skip to content

Instantly share code, notes, and snippets.

@hodlbirb
Created January 21, 2017 07:22
Show Gist options
  • Save hodlbirb/0eab5d589d10e53a6cbbcc479b793eeb to your computer and use it in GitHub Desktop.
Save hodlbirb/0eab5d589d10e53a6cbbcc479b793eeb to your computer and use it in GitHub Desktop.
#!/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