X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=ex;h=e0ea044c4698753ea6ded729ea3d4ba9617ba1ca;hb=e1828c55ddc97196af903d0a39eaebdba46a6b44;hp=10175a06e8ed6f9c0295881d90671fcac1ffb263;hpb=97ce487801e34743d528cd20faefa899906e83e1;p=small-misc-bash diff --git a/ex b/ex index 10175a0..e0ea044 100755 --- a/ex +++ b/ex @@ -15,12 +15,15 @@ ex() { local help="Usage: ex [--help] FILE... -Extract each FILE according to its extension. -7z bz2 deb gz iso dsc rar rpm tar xz zip & some combinations. +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 @@ -32,7 +35,7 @@ to try it out sometime." *.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" ;; @@ -54,7 +57,9 @@ to try it out sometime." ;; *.r[0-9][0-9]|*.rar ) unrar x "$x" ;; *.dsc) dpkg-source -x "$x" ;; - *) echo "I don't kno how to extract $x";; + *.sfs) $super unsquashfs "$x" ;; + *.jar) jar xf "$x" ;; + *) echo "I don't know how to extract $x";; esac done }