|
|
@ -3,21 +3,21 @@ |
|
|
|
if [ -f "$1" ] ; then |
|
|
|
if [ -f "$1" ] ; then |
|
|
|
case "$1" in |
|
|
|
case "$1" in |
|
|
|
*.tar.bz2) |
|
|
|
*.tar.bz2) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
tar xvjf "$1" -C "$2" |
|
|
|
tar xvjf "$1" -C "$2" |
|
|
|
else |
|
|
|
else |
|
|
|
tar xvjf "$1" |
|
|
|
tar xvjf "$1" |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
*.tar.gz) |
|
|
|
*.tar.gz) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
tar xvzf "$1" -C "$2" |
|
|
|
tar xvzf "$1" -C "$2" |
|
|
|
else |
|
|
|
else |
|
|
|
tar xvzf "$1" |
|
|
|
tar xvzf "$1" |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
*.bz2) |
|
|
|
*.bz2) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
bunzip -c "$1" > "$2" |
|
|
|
bunzip -c "$1" > "$2" |
|
|
|
else |
|
|
|
else |
|
|
|
bunzip "$1" |
|
|
|
bunzip "$1" |
|
|
@ -25,14 +25,14 @@ if [ -f "$1" ] ; then |
|
|
|
;; |
|
|
|
;; |
|
|
|
#*.rar) rar x "$1" ;; |
|
|
|
#*.rar) rar x "$1" ;; |
|
|
|
*.gz) |
|
|
|
*.gz) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
gunzip -c "$1" > "$2" |
|
|
|
gunzip -c "$1" > "$2" |
|
|
|
else |
|
|
|
else |
|
|
|
gunzip "$1" |
|
|
|
gunzip "$1" |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
*.rar) |
|
|
|
*.rar) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
#tar xvf "$1" -C "$2" |
|
|
|
#tar xvf "$1" -C "$2" |
|
|
|
echo "Look into how to unrar into directory" |
|
|
|
echo "Look into how to unrar into directory" |
|
|
|
else |
|
|
|
else |
|
|
@ -40,42 +40,42 @@ if [ -f "$1" ] ; then |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
*.tar) |
|
|
|
*.tar) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
tar xvf "$1" -C "$2" |
|
|
|
tar xvf "$1" -C "$2" |
|
|
|
else |
|
|
|
else |
|
|
|
tar xvf "$1" |
|
|
|
tar xvf "$1" |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
*.tbz2) |
|
|
|
*.tbz2) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
tar xvjf "$1" -C "$2" |
|
|
|
tar xvjf "$1" -C "$2" |
|
|
|
else |
|
|
|
else |
|
|
|
tar xvjf "$1" |
|
|
|
tar xvjf "$1" |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
*.tgz) |
|
|
|
*.tgz) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
tar xvzf "$1" -C "$2" |
|
|
|
tar xvzf "$1" -C "$2" |
|
|
|
else |
|
|
|
else |
|
|
|
tar xvzf "$1" |
|
|
|
tar xvzf "$1" |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
*.zip) |
|
|
|
*.zip) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
unzip "$1" -d "$2" |
|
|
|
unzip "$1" -d "$2" |
|
|
|
else |
|
|
|
else |
|
|
|
unzip "$1" |
|
|
|
unzip "$1" |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
*.Z) |
|
|
|
*.Z) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
uncompress -c "$1" > "$2" |
|
|
|
uncompress -c "$1" > "$2" |
|
|
|
else |
|
|
|
else |
|
|
|
uncompress "$1" |
|
|
|
uncompress "$1" |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
*.7z) |
|
|
|
*.7z) |
|
|
|
if [ ""$2"" ]; then |
|
|
|
if [ "$2" ]; then |
|
|
|
7z x "$1" -o"$2" |
|
|
|
7z x "$1" -o"$2" |
|
|
|
else |
|
|
|
else |
|
|
|
7z x "$1" |
|
|
|
7z x "$1" |
|
|
|