diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-10-21 12:04:23 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-10-21 12:04:23 +0200 |
commit | a9410fab95292c8698b7e5e7a1f9268cb8e590e0 (patch) | |
tree | 6d78de30d24048d8be54cf237f4a1b266aeba4e1 /etc/functions/extract | |
parent | 834f0ce07b8224c9cee6985f0256d0a3fd6e5ae9 (diff) |
extract: Allow partial extraction of tar archives
Diffstat (limited to 'etc/functions/extract')
-rw-r--r-- | etc/functions/extract | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/etc/functions/extract b/etc/functions/extract index ac98916..f2eeb27 100644 --- a/etc/functions/extract +++ b/etc/functions/extract @@ -9,8 +9,8 @@ function confirm_shar { if [[ -f $1 ]] { case $1 in - *.(tar.bz2|bz2)) tar xvjf $1 ;; - *.(tar.gz|tgz)) tar xvzf $1 ;; + *.(tar.bz2|bz2)) tar xvjf $* ;; + *.(tar.gz|tgz)) tar xvzf $* ;; *.tar.lzma) unlzma $1 | tar xv ;; *.ace) unace e $1 ;; *.rar) unrar x $1 ;; @@ -18,7 +18,7 @@ if [[ -f $1 ]] { *.bz2) bzip2 -d $1 ;; *.lzh) lha x $1 ;; *.gz) gunzip -d $1 ;; - *.tar) tar xvf $1 ;; + *.tar) tar xvf $* ;; *.zip) unzip $1 ;; *.Z) uncompress $1 ;; *.shar) confirm_shar && sh $1 ;; |