Updated extract script
This commit is contained in:
1 parent
00dca735da
commit
d8f9a4c972
2 files changed
+10
-2
No files matched your search
+5
-1
@@ -39,7 +39,11 @@ extract(){
|
|||||||
*.tar) tar xf $1 ;;
|
*.tar) tar xf $1 ;;
|
||||||
*.tbz2) tar xjf $1 ;;
|
*.tbz2) tar xjf $1 ;;
|
||||||
*.tgz) tar xzf $1 ;;
|
*.tgz) tar xzf $1 ;;
|
||||||
*.zip) unzip $1 ;;
|
*.zip) if [ -n $2 ] ; then
|
||||||
|
unzip $1 -d $2
|
||||||
|
else
|
||||||
|
unzip $1
|
||||||
|
fi ;;
|
||||||
*.Z) uncompress $1 ;;
|
*.Z) uncompress $1 ;;
|
||||||
*.7z) 7z x $1 ;;
|
*.7z) 7z x $1 ;;
|
||||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||||
|
|||||||
@@ -73,7 +73,11 @@ extract(){
|
|||||||
*.tar) tar xf $1 ;;
|
*.tar) tar xf $1 ;;
|
||||||
*.tbz2) tar xjf $1 ;;
|
*.tbz2) tar xjf $1 ;;
|
||||||
*.tgz) tar xzf $1 ;;
|
*.tgz) tar xzf $1 ;;
|
||||||
*.zip) unzip $1 ;;
|
*.zip) if [ -n $2 ] ; then
|
||||||
|
unzip $1 -d $2
|
||||||
|
else
|
||||||
|
unzip $1
|
||||||
|
fi;;
|
||||||
*.Z) uncompress $1 ;;
|
*.Z) uncompress $1 ;;
|
||||||
*.7z) 7z x $1 ;;
|
*.7z) 7z x $1 ;;
|
||||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||||
|
|||||||
Reference in new issue
Block a user