uppercase control

This commit is contained in:
radikal
2020-09-29 17:04:56 +02:00
parent 1c285fcf57
commit 45c9a4185b
2 changed files with 29 additions and 20 deletions
+14 -10
View File
@@ -1,33 +1,37 @@
#!/bin/bash
function lowercase()
{
echo "$DEST" | tr 'A-Z' 'a-z'
}
function decompressor()
{
case $1 in
case $(lowercase) in
*.tar)
tar -xvf $1
tar -xvf $DEST
;;
*.tar.gz | *.tgz)
tar -xzvf $1
tar -xzvf $DEST
;;
*.tar.bz2 | *.tbz | *.tbz2 | *.tb2)
tar xjf $1
tar xjf $DEST
;;
*.tar.xz | *.txz)
tar -xf $1
tar -xf $DEST
;;
*.bz2)
bzip2 -d $1
bzip2 -d $DEST
;;
*.gz)
gzip -d $1
gzip -d $DEST
;;
*.zip)
unzip $1
unzip $DEST
;;
*.7z)
7za e $1
7za e $DEST
;;
*.rar)
unrar x $1
unrar x $DEST
;;
*)
echo "Extension not found."