You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

40 lines
811 B

#!/usr/bin/env bash
function compressor()
{
case $(lowercase) in
*.tar)
tar -cvf $DEST $ORIG
;;
*.tar.gz | *.tgz)
tar -czvf $DEST $ORIG
;;
*.tar.bz2 | *.tbz | *.tbz2 | *.tb2)
tar -c $ORIG | bzip2 > $DEST
;;
*.tar.xz | *.txz)
tar -cJf $DEST $ORIG
;;
*.bz2)
bzip2 -c $ORIG > $DEST
;;
*.gz)
gzip -c $ORIG > $DEST
;;
*.zip)
zip -r $DEST $ORIG
;;
*.7z)
7za a $DEST $ORIG
;;
*.rar)
rar a $DEST $ORIG
;;
*)
echo "Extension not found."
echo -e "For more information run 'lch --help'\n"
;;
esac
echo -e "\nDone"
}