From 6c1e2ec9f4a4728dd6338b2e4ea648f6b5cd59ae Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 26 Jun 2008 19:31:30 +0200 Subject: etc/functions: Splitup into seperate files per function --- etc/functions/extr | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 etc/functions/extr (limited to 'etc/functions/extr') diff --git a/etc/functions/extr b/etc/functions/extr new file mode 100644 index 0000000..784671b --- /dev/null +++ b/etc/functions/extr @@ -0,0 +1,24 @@ +# 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 +} -- cgit v1.2.3