Created
September 10, 2009 17:22
-
-
Save TaurusOlson/184665 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
############################################################################## | |
# cleanlatex 0.1 | |
# by Taurus Olson | |
# 1/02/09 | |
#cleanlatex is a small program made in order to clean Latex directories full of useless files | |
# before removing them all he makes a backup directory that you can delete if you're sure it is safe | |
############################################################################## | |
directory=cleaned | |
for useless in *.toc *.mtc* *.maf *.aux *.bbl *.blg *.log *.out *.stc* *.ptc* *.nav *.snm | |
do | |
if [[ -f $PWD/$useless ]] | |
then | |
echo $PWD/$useless | |
if [[ -d $PWD/$directory ]] | |
then | |
cp $PWD/$useless $PWD/$directory | |
else mkdir $PWD/$directory | |
cp $PWD/$useless $PWD/$directory | |
fi | |
fi | |
done | |
value=0 | |
for useless in *.toc *.mtc* *.maf *.aux *.bbl *.blg *.log *.out *.stc* *.ptc* *.nav *.snm | |
do | |
if [[ -f $useless ]] | |
then | |
rm $useless | |
(( value= value + 1 )) | |
fi | |
done | |
echo -e "\n"$value "files were deleted." | |
~ | |
~ | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment