function modules

This commit is contained in:
ale
2020-09-27 17:37:30 +02:00
parent 29d3a6c1af
commit 3dda858895
5 changed files with 182 additions and 176 deletions
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
function compressor()
{
case $1 in
*.tar)
tar -cvf $1 $2
;;
*.tar.gz | *.tgz)
tar -czvf $1 $2
;;
*.tar.bz2 | *.tbz | *.tbz2 | *.tb2)
tar -c $2 | bzip2 > $1
;;
*.tar.xz | *.txz)
tar -cJf $1 $2
;;
*.bz2)
bzip2 -c $2 > $1
;;
*.gz)
gzip -c $2 > $1
;;
*.zip)
zip -r $1 $2
;;
*.7z)
7za a $1 $2
;;
*.rar)
rar a $1 $2
;;
*)
echo "Extension not found."
echo -e "For more information run 'lch --help'\n"
;;
esac
echo -e "\nDone"
exit 0
}