summaryrefslogtreecommitdiff
path: root/etc/functions/extr
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-28 10:08:14 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-28 10:08:14 +0200
commit8896ac675b5bf513074d7552da7d9f4cf8d16217 (patch)
tree8c126c7993d9148658f9e0dff4033194c88f5ecd /etc/functions/extr
parentb906e284447b1515056b8a763d32fb5f4a78b28b (diff)
now use autoloading for functions
Diffstat (limited to 'etc/functions/extr')
-rw-r--r--etc/functions/extr44
1 files changed, 21 insertions, 23 deletions
diff --git a/etc/functions/extr b/etc/functions/extr
index 784671b..98d3ffe 100644
--- a/etc/functions/extr
+++ b/etc/functions/extr
@@ -1,24 +1,22 @@
# builtin function for archives, see $ZDIR/alias_suffix
-extr () {
- if [[ -f "$1" ]]; then
- case "$1" in
- *.tar.bz2) tar xjvf "$1" ;;
- *.tar.gz) tar xvzf "$1" ;;
- *.ace) unace e "$1" ;;
- *.rar) unrar x "$1" ;;
- *.deb) ar -x "$1" ;;
- *.bz2) bzip2 -d "$1" ;;
- *.lzh) lha x "$1" ;;
- *.gz) gunzip -d "$1" ;;
- *.tar) tar xvf "$1" ;;
- *.tgz) gunzip -d "$1" ;;
- *.tbz2) tar jxvf "$1" ;;
- *.zip) unzip "$1" ;;
- *.Z) uncompress "$1" ;;
- *.shar) sh "$1" ;;
- *) echo "I don't know the archive type of '"$1"' :(" ;;
- esac
- else
- echo "Hm. Seems '"$1"' is not a valid file."
- fi
-}
+if [[ -f "$1" ]]; then
+ case "$1" in
+ *.tar.bz2) tar xjvf "$1" ;;
+ *.tar.gz) tar xvzf "$1" ;;
+ *.ace) unace e "$1" ;;
+ *.rar) unrar x "$1" ;;
+ *.deb) ar -x "$1" ;;
+ *.bz2) bzip2 -d "$1" ;;
+ *.lzh) lha x "$1" ;;
+ *.gz) gunzip -d "$1" ;;
+ *.tar) tar xvf "$1" ;;
+ *.tgz) gunzip -d "$1" ;;
+ *.tbz2) tar jxvf "$1" ;;
+ *.zip) unzip "$1" ;;
+ *.Z) uncompress "$1" ;;
+ *.shar) sh "$1" ;;
+ *) echo "I don't know the archive type of '"$1"' :(" ;;
+ esac
+else
+ echo "Hm. Seems '"$1"' is not a valid file."
+fi