diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-08-26 21:06:10 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-08-26 21:06:10 +0200 |
commit | e04baababaf7c29f62646ee86f9944a5f23dce5e (patch) | |
tree | fd600deeae987e167b8a207fcad2ff3d83feda92 /etc/functions | |
parent | e2e516e778dd0474e71b8bdcbe86cbc5c02139d3 (diff) |
Updated functions
* Removed unused cdl
* Reworked extr
Diffstat (limited to 'etc/functions')
-rw-r--r-- | etc/functions/cdl | 2 | ||||
-rw-r--r-- | etc/functions/extr | 42 |
2 files changed, 22 insertions, 22 deletions
diff --git a/etc/functions/cdl b/etc/functions/cdl deleted file mode 100644 index a23a0f6..0000000 --- a/etc/functions/cdl +++ /dev/null @@ -1,2 +0,0 @@ -cd "$1"; -ls; diff --git a/etc/functions/extr b/etc/functions/extr index 98d3ffe..830d263 100644 --- a/etc/functions/extr +++ b/etc/functions/extr @@ -1,22 +1,24 @@ # builtin function for archives, see $ZDIR/alias_suffix -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"' :(" ;; +## vim:ft=zsh +if [[ -f $1 ]] { + case $1 in + *.tar.bz2) tar xvjf $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) xvzf $1 ;; + *.tbz2) tar xvjf $1 ;; + *.zip) unzip $1 ;; + *.Z) uncompress $1 ;; + *.shar) sh $1 ;; + *) echo "Unknown archive type: $1"; exit 2 ;; esac -else - echo "Hm. Seems '"$1"' is not a valid file." -fi +} else { + echo "Nu soch file: $1" + exit 1 +} |