Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 46 lines (37 sloc) 0.656 kb
#!/bin/bash
for args in "$@"
do
fname=$(readlink -f "$args")
bname=$(basename "$fname")
dest1st=${bname%.*}
dest2nd=${dest1st%.*}
case "$bname" in
*.tar.gz | *.tar.bz2 | *.tar.xz | *.tar.7z)
destdir=${dest2nd};;
*)
destdir=${dest1st};;
esac
mkdir "$destdir"
if [ "$?" != "0" ]
then
echo Directory creating failed.
exit 1
fi
cd "$destdir"
case "$bname" in
*.tar.bz2 | *.tbz2)
tar xvjf "$fname";;
*.tar.gz | *.tgz)
tar xvzf "$fname";;
*.tar.xz | *.txz)
tar xvJf "$fname";;
*.tar.7z | *.t7z)
7z x -so "$fname" | tar xf -;;
*.deb)
ar x "$fname";;
*)
7z x "$fname";;
esac
cd $OLDPWD
done
exit 0
Jump to Line
Something went wrong with that request. Please try again.