X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=ex;h=e0ea044c4698753ea6ded729ea3d4ba9617ba1ca;hb=e1828c55ddc97196af903d0a39eaebdba46a6b44;hp=44bb4622737dfd203a6a45d23fd0eb615d3f298d;hpb=c1d5265018efa027591fe20b5d671a9737ba3d05;p=small-misc-bash diff --git a/ex b/ex old mode 100644 new mode 100755 index 44bb462..e0ea044 --- a/ex +++ b/ex @@ -15,9 +15,15 @@ ex() { local help="Usage: ex [--help] FILE... -Extract each FILE according to its extension. -7z bz2 deb gz iso rar rpm tar xz zip & variations. -See source for exact file extensions." +Extract many types of files + +Based on their extensions, +7z bz2 deb gz iso dsc rar rpm tar xz zip sfs & some combinations. +See source for exact file extensions. +Note: apt-get install dtrx will do the same for +most of these types, plus some more, I'm going +to try it out sometime." + if [[ $1 == --help ]]; then echo "$help" fi @@ -29,7 +35,7 @@ See source for exact file extensions." *.bz2 ) bunzip2 "$x" ;; *.gz ) gunzip "$x" ;; *.tar ) tar xf "$x" ;; - *.zip ) unzip "$x" ;; + *.zip|*.xpi ) unzip "$x" ;; *.Z ) uncompress "$x" ;; *.7z ) 7za x "$x" ;; *.deb ) ar x "$x" ;; @@ -50,7 +56,10 @@ See source for exact file extensions." $super umount "$temp_dir" ;; *.r[0-9][0-9]|*.rar ) unrar x "$x" ;; - *) echo "I don't kno how to extract $x";; + *.dsc) dpkg-source -x "$x" ;; + *.sfs) $super unsquashfs "$x" ;; + *.jar) jar xf "$x" ;; + *) echo "I don't know how to extract $x";; esac done }