x.sh (938B)
1 #!/bin/sh 2 3 # extractor script 4 # by Michael Constantine Dimopoulos 5 # Website: https://mcdim.xyz 6 # Email: mk@mcdim.xyz 7 8 ext=$( echo $1 | rev | cut -d . -f1 | rev ) 9 bn=$( echo $1 | rev | cut -d . -f2- | rev ) 10 11 if [ "$ext" = "zip" ]; then unzip "$1"; 12 elif [ "$ext" = "gz" ]; then gzip -d "$1"; 13 elif [ "$ext" = "tar" ]; then tar xzf "$1"; 14 elif [ "$ext" = "tar.gz" ]; then tar xzf "$1"; 15 elif [ "$ext" = "7zip" ]; then 7za e "$1"; 16 elif [ "$ext" = "7z" ]; then 7za e "$1"; 17 elif [ "$ext" = "bzip2" ]; then bzip2 -d "$1"; 18 elif [ "$ext" = "tar.bz2" ]; then tar xf "$1"; 19 elif [ "$ext" = "rar" ]; then unrar x "$1"; 20 elif [ "$ext" = "Z" ]; then uncompress "$1"; 21 elif [ "$ext" = "lzma" ]; then lzma -d --stdout "$1" >"$bn"; 22 elif [ "$ext" = "xz" ]; then xz -d "$1"; 23 elif [ "$ext" = "shar" ]; then unshar "$1"; 24 elif [ "$ext" = "cpio" ]; then cpio -idv <"$1"; 25 elif [ "$ext" = "a" ]; then ar -xv "$1"; 26 elif [ "$ext" = "kgb" ]; then kgb x "$1"; 27 fi