remove incorrectly [un]compressed files
This commit is contained in:
parent
efb946c754
commit
030b945b08
14
functions.sh
14
functions.sh
|
@ -20,9 +20,9 @@ extract () {
|
||||||
*.tar) tar xf $1 ;;
|
*.tar) tar xf $1 ;;
|
||||||
*.bz2) which lbunzip2 &>/dev/null \
|
*.bz2) which lbunzip2 &>/dev/null \
|
||||||
&& lbunzip2 -kn$((`grep "^processor" /proc/cpuinfo -c`+1)) $1 \
|
&& lbunzip2 -kn$((`grep "^processor" /proc/cpuinfo -c`+1)) $1 \
|
||||||
|| bunzip2 -c $1 > ${1%.bz2} ;;
|
|| bunzip2 -k $1 ;;
|
||||||
*.gz) gunzip -c $1 > ${1%.gz} ;;
|
*.gz) gunzip -c $1 > ${1%.gz} || rm -f ${1%.gz} ;;
|
||||||
*.xz) unxz -c $1 > ${1%.xz} ;;
|
*.xz) unxz -k $1 ;;
|
||||||
*.rar) unrar x $1 ;;
|
*.rar) unrar x $1 ;;
|
||||||
*.zip) unzip $1 ;;
|
*.zip) unzip $1 ;;
|
||||||
#*.Z) uncompress $1 ;;
|
#*.Z) uncompress $1 ;;
|
||||||
|
@ -41,15 +41,15 @@ pk () {
|
||||||
echo "too many parameters to pk ()"
|
echo "too many parameters to pk ()"
|
||||||
elif [ $1 ] ; then
|
elif [ $1 ] ; then
|
||||||
case $1 in
|
case $1 in
|
||||||
t*b*z*) tar cjvf $2.tar.bz2 $2 ;; # FIXME: make parallel with lbzip2
|
t*b*z*) tar cjvf $2.tar.bz2 $2 ;;
|
||||||
t*g*z) tar czvf $2.tar.gz $2 ;;
|
t*g*z) tar czvf $2.tar.gz $2 ;;
|
||||||
t*x*|t*J*) tar cJvf $2.tar.xz $2 ;;
|
t*x*|t*J*) tar cJvf $2.tar.xz $2 ;;
|
||||||
t*r) tar cpvf $2.tar $2 ;;
|
t*r) tar cpvf $2.tar $2 ;;
|
||||||
b*z*) which lbzip2 &>/dev/null \
|
b*z*) which lbzip2 &>/dev/null \
|
||||||
&& lbzip2 -9 -kn$((`grep "^processor" /proc/cpuinfo -c`+1)) $2 \
|
&& lbzip2 -9 -kn$((`grep "^processor" /proc/cpuinfo -c`+1)) $2 \
|
||||||
|| bzip2 -9 -c $2 > $2.bz2 ;;
|
|| bzip2 -9 -k $2 ;;
|
||||||
g*z) gzip -c -9 -n $2 > $2.gz ;;
|
g*z) gzip -c -9 -n $2 > $2.gz || rm -f $2.gz ;;
|
||||||
x*z) xz -c -9 $2 > $2.xz ;;
|
x*z) xz -k -9 $2 ;;
|
||||||
rar) rar a $2.rar $2 -m5 ;;
|
rar) rar a $2.rar $2 -m5 ;;
|
||||||
zip) zip -9 -r $2.zip $2 ;;
|
zip) zip -9 -r $2.zip $2 ;;
|
||||||
#Z) ;;
|
#Z) ;;
|
||||||
|
|
Loading…
Reference in New Issue